]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix assert() with side effects
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 14 Jul 2013 03:00:32 +0000 (21:00 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 14 Jul 2013 03:00:32 +0000 (21:00 -0600)
assert() may be completely removed by precompiler when optimizing. Such
that the code conditional never gets run.

src/HttpRequest.cc

index bfb6e571ea000d44213a0a0a8539f6cb2e806e4e..036080781589803bec4cb7d94194d694d01325cc 100644 (file)
@@ -234,7 +234,8 @@ HttpRequest::clone() const
     copy->extacl_log = extacl_log;
     copy->extacl_message = extacl_message;
 
-    assert(copy->inheritProperties(this));
+    const bool inheritWorked = copy->inheritProperties(this);
+    assert(inheritWorked);
 
     return copy;
 }