From 7bb6ab3c5be9a5cece7ee4e01bb9a9f2e8c28a0c Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 14 Jun 2014 19:28:09 +0400 Subject: [PATCH] Eliminate side effect in assertion condition in disclaim_bench (code refactoring) * tests/disclaim_bench.c (testobj_finalize): Move "i" field increment out of assertion condition; replace increment with assignment. --- tests/disclaim_bench.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/disclaim_bench.c b/tests/disclaim_bench.c index 5159829..f9bfc58 100644 --- a/tests/disclaim_bench.c +++ b/tests/disclaim_bench.c @@ -38,7 +38,8 @@ typedef struct testobj_s *testobj_t; void GC_CALLBACK testobj_finalize(void *obj, void *carg) { ++*(int *)carg; - my_assert(((testobj_t)obj)->i++ == 109); + my_assert(((testobj_t)obj)->i == 109); + ((testobj_t)obj)->i = 110; } static const struct GC_finalizer_closure fclos = { -- 2.7.4