mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 747926 - Preserve type tag when overwriting VM stack values (r=bhackett)
This commit is contained in:
parent
cc31724901
commit
76240c5634
12
js/src/jit-test/tests/basic/bug747926.js
Normal file
12
js/src/jit-test/tests/basic/bug747926.js
Normal file
@ -0,0 +1,12 @@
|
||||
a = 'a';
|
||||
b = [,];
|
||||
exhaustiveSliceTest("exhaustive slice test 1", a);
|
||||
print('---');
|
||||
exhaustiveSliceTest("exhaustive slice test 2", b);
|
||||
function exhaustiveSliceTest(testname, a){
|
||||
x = 0
|
||||
var y = 0;
|
||||
countHeap();
|
||||
for (y=a.length; y + a.length; y--) { print(y);
|
||||
var b = a.slice(x,y); }
|
||||
}
|
@ -484,11 +484,16 @@ StackSpace::markFrameSlots(JSTracer *trc, StackFrame *fp, Value *slotsEnd, jsbyt
|
||||
for (Value *vp = slotsBegin; vp < fixedEnd; vp++) {
|
||||
uint32_t slot = analyze::LocalSlot(script, vp - slotsBegin);
|
||||
|
||||
/* Will this slot be synced by the JIT? */
|
||||
/*
|
||||
* Will this slot be synced by the JIT? If not, replace with a dummy
|
||||
* value with the same type tag.
|
||||
*/
|
||||
if (!analysis->trackSlot(slot) || analysis->liveness(slot).live(offset))
|
||||
gc::MarkValueRoot(trc, vp, "vm_stack");
|
||||
else
|
||||
*vp = UndefinedValue();
|
||||
else if (vp->isObject())
|
||||
*vp = ObjectValue(fp->scopeChain()->global());
|
||||
else if (vp->isString())
|
||||
*vp = StringValue(trc->runtime->atomState.nullAtom);
|
||||
}
|
||||
|
||||
gc::MarkValueRootRange(trc, fixedEnd, slotsEnd, "vm_stack");
|
||||
|
Loading…
Reference in New Issue
Block a user