mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
LibJS/JIT: Preserve the accumulator across PutByFoo
This ensures that we don't clobber the accumulator when putting a value to a setter.
This commit is contained in:
parent
5bd93f34af
commit
8a24d00b1a
1 changed files with 2 additions and 0 deletions
|
@ -709,6 +709,7 @@ static Value cxx_put_by_id(VM& vm, Value base, Bytecode::IdentifierTableIndex pr
|
|||
{
|
||||
PropertyKey name = vm.bytecode_interpreter().current_executable().get_identifier(property);
|
||||
TRY_OR_SET_EXCEPTION(Bytecode::put_by_property_key(vm, base, base, value, name, kind));
|
||||
vm.bytecode_interpreter().accumulator() = value;
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@ -729,6 +730,7 @@ void Compiler::compile_put_by_id(Bytecode::Op::PutById const& op)
|
|||
static Value cxx_put_by_value(VM& vm, Value base, Value property, Value value, Bytecode::Op::PropertyKind kind)
|
||||
{
|
||||
TRY_OR_SET_EXCEPTION(Bytecode::put_by_value(vm, base, property, value, kind));
|
||||
vm.bytecode_interpreter().accumulator() = value;
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue