Revert 3336, try fix #2 (bug 4852, r=dvander)
This commit is contained in:
parent
264ffa80ce
commit
4d52fe0490
@ -386,6 +386,7 @@ typedef struct s_stringpair {
|
|||||||
#define tSTRING 340
|
#define tSTRING 340
|
||||||
#define tEXPR 341 /* for assigment to "lastst" only (see SC1.C) */
|
#define tEXPR 341 /* for assigment to "lastst" only (see SC1.C) */
|
||||||
#define tENDLESS 342 /* endless loop, for assigment to "lastst" only */
|
#define tENDLESS 342 /* endless loop, for assigment to "lastst" only */
|
||||||
|
#define tEMPTYBLOCK 343 /* empty blocks for AM bug 4825 */
|
||||||
|
|
||||||
/* (reversed) evaluation of staging buffer */
|
/* (reversed) evaluation of staging buffer */
|
||||||
#define sSTARTREORDER 0x01
|
#define sSTARTREORDER 0x01
|
||||||
|
@ -5660,9 +5660,13 @@ static void statement(int *lastindent,int allow_decl)
|
|||||||
case '{':
|
case '{':
|
||||||
case tBEGIN:
|
case tBEGIN:
|
||||||
save=fline;
|
save=fline;
|
||||||
if (!matchtoken('}')) /* {} is the empty statement */
|
if (!matchtoken('}')) { /* {} is the empty statement */
|
||||||
compound(save==fline,tok);
|
compound(save==fline,tok);
|
||||||
/* lastst (for "last statement") does not change */
|
} else {
|
||||||
|
lastst = tEMPTYBLOCK;
|
||||||
|
}
|
||||||
|
/* lastst (for "last statement") does not change
|
||||||
|
you're not my father, don't tell me what to do */
|
||||||
break;
|
break;
|
||||||
case ';':
|
case ';':
|
||||||
error(36); /* empty statement */
|
error(36); /* empty statement */
|
||||||
@ -5990,6 +5994,12 @@ static int doif(void)
|
|||||||
setlabel(flab1); /* print false label */
|
setlabel(flab1); /* print false label */
|
||||||
statement(NULL,FALSE); /* do "else" clause */
|
statement(NULL,FALSE); /* do "else" clause */
|
||||||
setlabel(flab2); /* print true label */
|
setlabel(flab2); /* print true label */
|
||||||
|
/* if both the "true" branch and the "false" branch ended with the same
|
||||||
|
* kind of statement, set the last statement id to that kind, rather than
|
||||||
|
* to the generic tIF; this allows for better "unreachable code" checking
|
||||||
|
*/
|
||||||
|
if (lastst==lastst_true)
|
||||||
|
return lastst;
|
||||||
} /* if */
|
} /* if */
|
||||||
return tIF;
|
return tIF;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user