Bug 1270977 - Mini-followup: JS::detail::ComputeThis must overwrite vp[1] with the boxed |this| object, because various downstream code assumes it's been overwritten (particularly in error cases). r=colors

This commit is contained in:
Jeff Walden 2016-05-28 22:52:07 -07:00
parent 70329fa4a6
commit f20341eae2

View File

@ -1310,8 +1310,8 @@ JS::detail::ComputeThis(JSContext* cx, Value* vp)
AssertHeapIsIdle(cx); AssertHeapIsIdle(cx);
assertSameCompartment(cx, JSValueArray(vp, 2)); assertSameCompartment(cx, JSValueArray(vp, 2));
RootedValue thisv(cx, vp[1]); MutableHandleValue thisv = MutableHandleValue::fromMarkedLocation(&vp[1]);
if (!BoxNonStrictThis(cx, thisv, &thisv)) if (!BoxNonStrictThis(cx, thisv, thisv))
return NullValue(); return NullValue();
return thisv; return thisv;