From: Amos Jeffries Date: Fri, 26 Jul 2013 11:40:37 +0000 (-0600) Subject: Fix assert() with side effects X-Git-Tag: SQUID_3_3_10~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=91d1580768a469d0a31cb5746a973448fbf7d2e9;p=thirdparty%2Fsquid.git Fix assert() with side effects assert() may be completely removed by precompiler when optimizing. Such that the code conditional never gets run. --- diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index e8e97c156a..94504d51d4 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -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; }