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

src/HttpRequest.cc

index e8e97c156a70ff1962ac0f15facb09425f68b046..94504d51d4578bd29cb44c7ec977eb9381d3ac64 100644 (file)
@@ -229,7 +229,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;
 }