mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 496270: correct use of C++ reference returned from function, r=gal
This commit is contained in:
parent
05f8dc2692
commit
1e04a40929
@ -8483,10 +8483,15 @@ JS_REQUIRES_STACK LIns*
|
||||
TraceRecorder::upvar(JSScript* script, JSUpvarArray* uva, uintN index, jsval& v)
|
||||
{
|
||||
/*
|
||||
* Try to find the upvar in the current trace's tracker.
|
||||
* Try to find the upvar in the current trace's tracker. For &vr to be
|
||||
* the address of the jsval found in js_GetUpvar, we must initialize
|
||||
* vr directly with the result, so it is a reference to the same location.
|
||||
* It does not work to assign the result to v, because v is an already
|
||||
* existing reference that points to something else.
|
||||
*/
|
||||
v = js_GetUpvar(cx, script->staticLevel, uva->vector[index]);
|
||||
LIns* upvar_ins = get(&v);
|
||||
jsval& vr = js_GetUpvar(cx, script->staticLevel, uva->vector[index]);
|
||||
v = vr;
|
||||
LIns* upvar_ins = get(&vr);
|
||||
if (upvar_ins) {
|
||||
return upvar_ins;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user