Fixed the handling of "while (0) {}".

It's a corner case; but, conditional macroes might create it -- better safe than sorry.
This commit is contained in:
Greg King
2017-04-07 09:26:58 -04:00
parent e43dbe1c24
commit 1aab287189
2 changed files with 88 additions and 34 deletions

View File

@@ -273,9 +273,6 @@ static void WhileStatement (void)
/* Remember the current position */
GetCodePos (&CondCodeStart);
/* Emit the code position label */
g_defcodelabel (CondLabel);
/* Test the loop condition */
TestInParens (LoopLabel, 1);
@@ -288,6 +285,9 @@ static void WhileStatement (void)
/* Loop body */
Statement (&PendingToken);
/* Emit the while condition label */
g_defcodelabel (CondLabel);
/* Move the test code here */
GetCodePos (&Here);
MoveCode (&CondCodeStart, &CondCodeEnd, &Here);