mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
fix js_IsLoopExit to better handle for-in exits, r=mrbkap
This commit is contained in:
parent
dd3e7fc8e5
commit
c66d3db3b8
@ -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:;
|
||||
|
Loading…
Reference in New Issue
Block a user