зеркало из https://github.com/mozilla/gecko-dev.git
Bug 787848 - Handle JSOP_THROWING opcode in the decompiler. r=luke
This commit is contained in:
Родитель
dcb00e1ea7
Коммит
428f856e78
|
@ -0,0 +1,7 @@
|
||||||
|
try {
|
||||||
|
i
|
||||||
|
}
|
||||||
|
catch (x if (function() {})()) {}
|
||||||
|
catch (d) {
|
||||||
|
this.z.z
|
||||||
|
}
|
|
@ -6441,8 +6441,10 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target,
|
||||||
if (!script->hasTrynotes())
|
if (!script->hasTrynotes())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If we do not follow a goto we look for another mean to continue
|
/*
|
||||||
// at the next PC.
|
* If we do not follow a goto we look for another mean to continue
|
||||||
|
* at the next PC.
|
||||||
|
*/
|
||||||
JSTryNote *tn = script->trynotes()->vector;
|
JSTryNote *tn = script->trynotes()->vector;
|
||||||
JSTryNote *tnEnd = tn + script->trynotes()->length;
|
JSTryNote *tnEnd = tn + script->trynotes()->length;
|
||||||
for (; tn != tnEnd; tn++) {
|
for (; tn != tnEnd; tn++) {
|
||||||
|
@ -6451,12 +6453,21 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target,
|
||||||
if (start < pc && pc <= end && end <= target)
|
if (start < pc && pc <= end && end <= target)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tn != tnEnd) {
|
if (tn != tnEnd) {
|
||||||
pcdepth = tn->stackDepth;
|
pcdepth = tn->stackDepth;
|
||||||
hpcdepth = unsigned(-1);
|
hpcdepth = unsigned(-1);
|
||||||
oplen = 0;
|
oplen = 0;
|
||||||
pc = script->main() + tn->start + tn->length;
|
pc = script->main() + tn->start + tn->length;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* JSOP_THROWING compensates for hidden JSOP_DUP at the start of the
|
||||||
|
* previous guarded catch (see EmitTry in BytecodeEmitter.cpp).
|
||||||
|
*/
|
||||||
|
if (JSOp(*(pc + oplen)) == JSOP_THROWING)
|
||||||
|
hpcdepth = pcdepth + 2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче