Ensure that `this` is properly populated into local registers.
This commit is contained in:
parent
b2f5307213
commit
5b00c1fd96
|
@ -140,6 +140,13 @@ impl<'gc> Activation<'gc> {
|
||||||
let method = method?;
|
let method = method?;
|
||||||
let scope = Some(Scope::push_scope(None, global, context.gc_context));
|
let scope = Some(Scope::push_scope(None, global, context.gc_context));
|
||||||
let num_locals = method.body().num_locals;
|
let num_locals = method.body().num_locals;
|
||||||
|
let local_registers =
|
||||||
|
GcCell::allocate(context.gc_context, RegisterSet::new(num_locals + 1));
|
||||||
|
|
||||||
|
*local_registers
|
||||||
|
.write(context.gc_context)
|
||||||
|
.get_mut(0)
|
||||||
|
.unwrap() = global.into();
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
method,
|
method,
|
||||||
|
@ -147,7 +154,7 @@ impl<'gc> Activation<'gc> {
|
||||||
this: global,
|
this: global,
|
||||||
arguments: None,
|
arguments: None,
|
||||||
is_executing: false,
|
is_executing: false,
|
||||||
local_registers: GcCell::allocate(context.gc_context, RegisterSet::new(num_locals)),
|
local_registers,
|
||||||
return_value: None,
|
return_value: None,
|
||||||
local_scope: ScriptObject::bare_object(context.gc_context),
|
local_scope: ScriptObject::bare_object(context.gc_context),
|
||||||
scope,
|
scope,
|
||||||
|
|
Loading…
Reference in New Issue