Skip to content

Commit

Permalink
Fix crash from incomplete do-while statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Cortez committed Sep 29, 2021
1 parent d266203 commit 3e0c5ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/compiler/sc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -5972,6 +5972,7 @@ static int test(int label,int parens,int invert)
cell cidx;
int ident,tag;
int endtok;
short save_intest;
cell constval;
symbol *sym;
int localstaging=FALSE;
Expand All @@ -5985,7 +5986,7 @@ static int test(int label,int parens,int invert)
#endif
} /* if */

PUSHSTK_I(sc_intest);
save_intest=sc_intest;
sc_intest=TRUE;
endtok=0;
if (parens!=TEST_PLAIN) {
Expand Down Expand Up @@ -6039,7 +6040,7 @@ static int test(int label,int parens,int invert)
else
jmp_eq0(label); /* jump to label if false (equal to 0) */
markexpr(sEXPR,NULL,0); /* end expression (give optimizer a chance) */
sc_intest=(short)POPSTK_I(); /* double typecast to avoid warning with Microsoft C */
sc_intest=save_intest;
if (localstaging) {
stgout(0); /* output queue from the very beginning (see
* assert() when localstaging is set to TRUE) */
Expand Down

0 comments on commit 3e0c5ba

Please sign in to comment.