Revert 3336, try fix #2 (bug 4852, r=dvander)

This commit is contained in:
Fyren 2011-07-09 20:47:43 -07:00
parent 264ffa80ce
commit 4d52fe0490
2 changed files with 13 additions and 2 deletions

View File

@ -386,6 +386,7 @@ typedef struct s_stringpair {
#define tSTRING 340
#define tEXPR 341 /* for assigment to "lastst" only (see SC1.C) */
#define tENDLESS 342 /* endless loop, for assigment to "lastst" only */
#define tEMPTYBLOCK 343 /* empty blocks for AM bug 4825 */
/* (reversed) evaluation of staging buffer */
#define sSTARTREORDER 0x01

View File

@ -5660,9 +5660,13 @@ static void statement(int *lastindent,int allow_decl)
case '{':
case tBEGIN:
save=fline;
if (!matchtoken('}')) /* {} is the empty statement */
if (!matchtoken('}')) { /* {} is the empty statement */
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;
case ';':
error(36); /* empty statement */
@ -5990,6 +5994,12 @@ static int doif(void)
setlabel(flab1); /* print false label */
statement(NULL,FALSE); /* do "else" clause */
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 */
return tIF;
}