From: Amos Jeffries Date: Sun, 14 Jul 2013 03:00:32 +0000 (-0600) Subject: Fix assert() with side effects X-Git-Tag: SQUID_3_4_0_1~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fbc1c5a6626478161b5b44e3f313e2ed8656975d;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 bfb6e571ea..0360807815 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -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; }