Skip to content

Commit 3e0c5ba

Browse files
committed
Fix crash from incomplete do-while statement
1 parent d266203 commit 3e0c5ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/compiler/sc1.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5972,6 +5972,7 @@ static int test(int label,int parens,int invert)
59725972
cell cidx;
59735973
int ident,tag;
59745974
int endtok;
5975+
short save_intest;
59755976
cell constval;
59765977
symbol *sym;
59775978
int localstaging=FALSE;
@@ -5985,7 +5986,7 @@ static int test(int label,int parens,int invert)
59855986
#endif
59865987
} /* if */
59875988

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

0 commit comments

Comments
 (0)