From 91d1580768a469d0a31cb5746a973448fbf7d2e9 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 26 Jul 2013 05:40:37 -0600 Subject: [PATCH] Fix assert() with side effects assert() may be completely removed by precompiler when optimizing. Such that the code conditional never gets run. --- src/HttpRequest.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.47.2