From 74d7034386679789c3e835c2d104941fd6c759d3 Mon Sep 17 00:00:00 2001 From: johanknol Date: Tue, 23 Oct 2001 12:40:19 +0000 Subject: [PATCH] fixed bug #443366 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1436 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCast.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SDCCast.c b/src/SDCCast.c index 9beec54f..4572ac76 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -3565,8 +3565,12 @@ createIf (ast * condAst, ast * ifBody, ast * elseBody) symbol *ifTrue, *ifFalse, *ifEnd; /* if neither exists */ - if (!elseBody && !ifBody) - return condAst; + if (!elseBody && !ifBody) { + // if there are no side effects (i++, j() etc) + if (!hasSEFcalls(condAst)) { + return condAst; + } + } /* create the labels */ sprintf (buffer, "_iffalse_%d", Lblnum); -- 2.47.2