mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 797496 - Ignore hidden PC even with try notes. r=luke
This commit is contained in:
parent
631713204c
commit
795fee3471
8
js/src/jit-test/tests/basic/bug797496.js
Normal file
8
js/src/jit-test/tests/basic/bug797496.js
Normal file
@ -0,0 +1,8 @@
|
||||
// |jit-test| error: TypeError
|
||||
var set = Set(['a']);
|
||||
var n = 5;
|
||||
for (let v of set) {
|
||||
if (n === 0)
|
||||
break;
|
||||
let g = set(Set(0xffffffff, n), 1);
|
||||
}
|
@ -6436,31 +6436,27 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target, jsbyteco
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!script->hasTrynotes()) {
|
||||
/* Use the normal pc count if continue after the goto */
|
||||
hpcdepth = unsigned(-1);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we do not follow a goto we look for another mean to continue
|
||||
* at the next PC.
|
||||
*/
|
||||
JSTryNote *tn = script->trynotes()->vector;
|
||||
JSTryNote *tnEnd = tn + script->trynotes()->length;
|
||||
for (; tn != tnEnd; tn++) {
|
||||
jsbytecode *start = script->main() + tn->start;
|
||||
jsbytecode *end = start + tn->length;
|
||||
if (start < pc && pc <= end && end <= target)
|
||||
break;
|
||||
}
|
||||
if (script->hasTrynotes()) {
|
||||
JSTryNote *tn = script->trynotes()->vector;
|
||||
JSTryNote *tnEnd = tn + script->trynotes()->length;
|
||||
for (; tn != tnEnd; tn++) {
|
||||
jsbytecode *start = script->main() + tn->start;
|
||||
jsbytecode *end = start + tn->length;
|
||||
if (start < pc && pc <= end && end <= target)
|
||||
break;
|
||||
}
|
||||
|
||||
if (tn != tnEnd) {
|
||||
pcdepth = tn->stackDepth;
|
||||
hpcdepth = unsigned(-1);
|
||||
oplen = 0;
|
||||
pc = script->main() + tn->start + tn->length;
|
||||
continue;
|
||||
if (tn != tnEnd) {
|
||||
pcdepth = tn->stackDepth;
|
||||
hpcdepth = unsigned(-1);
|
||||
oplen = 0;
|
||||
pc = script->main() + tn->start + tn->length;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -6469,6 +6465,10 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target, jsbyteco
|
||||
*/
|
||||
if (JSOp(*(pc + oplen)) == JSOP_THROWING)
|
||||
hpcdepth = pcdepth + 2;
|
||||
else
|
||||
/* Use the normal pc count if continue after the goto */
|
||||
hpcdepth = unsigned(-1);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user