fix js_IsLoopExit to better handle for-in exits, r=mrbkap

This commit is contained in:
shaver@mozilla.org 2008-08-20 18:50:49 -07:00
parent 49f0b4f6cb
commit 9817a0cd97

View File

@ -1221,8 +1221,16 @@ js_IsLoopExit(JSContext* cx, JSScript* script, jsbytecode* pc)
pc++;
/* FALL THROUGH */
case JSOP_IFEQ:
case JSOP_IFEQX:
case JSOP_IFNE:
case JSOP_IFNEX:
/*
* Forward jumps are usually intra-branch, but for-in loops jump to the trailing enditer to
* clean up, so check for that case here.
*/
if (pc[GET_JUMP_OFFSET(pc)] == JSOP_ENDITER)
return true;
return GET_JUMP_OFFSET(pc) < 0;
default:;