Fix EmitJump to AddSpanDep if in all necessary cases (155081, the small crash-fix patch).

This commit is contained in:
brendan%mozilla.org 2005-03-29 02:45:03 +00:00
parent f307e91cbd
commit 8e521d1654

View File

@ -1135,16 +1135,16 @@ OptimizeSpanDeps(JSContext *cx, JSCodeGenerator *cg)
static JSBool
EmitJump(JSContext *cx, JSCodeGenerator *cg, JSOp op, ptrdiff_t off)
{
JSBool extend;
ptrdiff_t jmp;
jsbytecode *pc;
if (off < JUMP_OFFSET_MIN || JUMP_OFFSET_MAX < off) {
if (!cg->spanDeps && !BuildSpanDepTable(cx, cg))
return JS_FALSE;
}
extend = off < JUMP_OFFSET_MIN || JUMP_OFFSET_MAX < off;
if (extend && !cg->spanDeps && !BuildSpanDepTable(cx, cg))
return JS_FALSE;
jmp = js_Emit3(cx, cg, op, JUMP_OFFSET_HI(off), JUMP_OFFSET_LO(off));
if (jmp >= 0 && cg->spanDeps) {
if (jmp >= 0 && (extend || cg->spanDeps)) {
pc = CG_CODE(cg, jmp);
if (!AddSpanDep(cx, cg, pc, pc, off))
return JS_FALSE;