Fixed bug #316293; when break was very first statement in a loop it wasn't

getting patched and so looped for ever.
This commit is contained in:
rogerl%netscape.com 1998-09-14 22:33:19 +00:00
parent 19a2523b04
commit 46f5ffb26f
2 changed files with 2 additions and 2 deletions

View File

@ -290,7 +290,7 @@ PatchGotos(JSContext *cx, JSCodeGenerator *cg, JSStmtInfo *stmt,
pc = CG_CODE(cg, last);
top = CG_CODE(cg, stmt->top);
while (pc > top) {
while (pc != CG_CODE(cg, -1)) {
PR_ASSERT(*pc == JSOP_GOTO);
delta = GET_JUMP_OFFSET(pc);
jumpOffset = PTRDIFF(target, pc, jsbytecode);

View File

@ -62,7 +62,7 @@ struct JSStmtInfo {
};
#define SET_STATEMENT_TOP(stmt, top) \
((stmt)->top = (stmt)->update = (stmt)->breaks = (stmt)->continues = (top))
((stmt)->top = (stmt)->update = (top), (stmt)->breaks = (stmt)->continues = (-1))
struct JSTreeContext { /* tree context for semantic checks */
uint32 flags; /* statement state flags, see below */