mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Don't use wrong result value in stubs::SetElem, bug 620643. r=dmandelin
This commit is contained in:
parent
c8eee530e2
commit
b21aead711
1
js/src/jit-test/tests/jaeger/bug620643.js
Normal file
1
js/src/jit-test/tests/jaeger/bug620643.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var a = new Int32Array(); +(a[0]={});
|
@ -559,7 +559,7 @@ stubs::SetElem(VMFrame &f)
|
|||||||
|
|
||||||
Value &objval = regs.sp[-3];
|
Value &objval = regs.sp[-3];
|
||||||
Value &idval = regs.sp[-2];
|
Value &idval = regs.sp[-2];
|
||||||
Value retval = regs.sp[-1];
|
Value rval = regs.sp[-1];
|
||||||
|
|
||||||
JSObject *obj;
|
JSObject *obj;
|
||||||
jsid id;
|
jsid id;
|
||||||
@ -582,19 +582,19 @@ stubs::SetElem(VMFrame &f)
|
|||||||
if ((jsuint)i >= obj->getArrayLength())
|
if ((jsuint)i >= obj->getArrayLength())
|
||||||
obj->setArrayLength(i + 1);
|
obj->setArrayLength(i + 1);
|
||||||
}
|
}
|
||||||
obj->setDenseArrayElement(i, regs.sp[-1]);
|
obj->setDenseArrayElement(i, rval);
|
||||||
goto end_setelem;
|
goto end_setelem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
if (!obj->setProperty(cx, id, &retval, strict))
|
if (!obj->setProperty(cx, id, &rval, strict))
|
||||||
THROW();
|
THROW();
|
||||||
end_setelem:
|
end_setelem:
|
||||||
/* :FIXME: Moving the assigned object into the lowest stack slot
|
/* :FIXME: Moving the assigned object into the lowest stack slot
|
||||||
* is a temporary hack. What we actually want is an implementation
|
* is a temporary hack. What we actually want is an implementation
|
||||||
* of popAfterSet() that allows popping more than one value;
|
* of popAfterSet() that allows popping more than one value;
|
||||||
* this logic can then be handled in Compiler.cpp. */
|
* this logic can then be handled in Compiler.cpp. */
|
||||||
regs.sp[-3] = retval;
|
regs.sp[-3] = regs.sp[-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
template void JS_FASTCALL stubs::SetElem<true>(VMFrame &f);
|
template void JS_FASTCALL stubs::SetElem<true>(VMFrame &f);
|
||||||
|
Loading…
Reference in New Issue
Block a user