]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 5232: Fix GCC v12 build [-Wuse-after-free] (#1136)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Wed, 14 Sep 2022 06:47:52 +0000 (06:47 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 14 Sep 2022 19:00:18 +0000 (19:00 +0000)
This warning is a false positive. Introduced in GCC v12, use-after-free
checks have attracted dozens of bug reports, with several reports still
open as of GCC v12.2, including one that looks very similar to our case:
https://gcc.gnu.org/bugzilla//show_bug.cgi?id=106776

Removing (excessive) "inline" works around this GCC bug. We do not have
a better workaround right now. If we see more false positives like this,
we may disable -Wuse-after-free until its support matures.

src/base/AsyncCall.h

index ae43662bf0b713d06f27ec3c327019eba1bdeb24..42e86e43482918b767019b1903e023451f7b9ab7 100644 (file)
@@ -151,7 +151,7 @@ private:
 };
 
 template <class Dialer>
-inline RefCount< AsyncCallT<Dialer> >
+RefCount< AsyncCallT<Dialer> >
 asyncCall(int aDebugSection, int aDebugLevel, const char *aName,
           const Dialer &aDialer)
 {