diff --git a/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp b/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp index a98f5bd9d3..d9a4651ef4 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp +++ b/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp @@ -126,7 +126,7 @@ void BytecodeInterpreter::call_address(Configuration& configuration, FunctionAdd for (auto& entry : span) { auto* ptr = entry.get_pointer(); TRAP_IF_NOT(ptr != nullptr); - args.unchecked_append(*ptr); + args.unchecked_append(move(*ptr)); } configuration.stack().entries().remove(configuration.stack().size() - span.size(), span.size()); @@ -173,7 +173,7 @@ void BytecodeInterpreter::binary_numeric_operation(Configuration& configuration) result = call_result; } dbgln_if(WASM_TRACE_DEBUG, "{} {} {} = {}", lhs.value(), Operator::name(), rhs.value(), result); - configuration.stack().peek() = Value(result); + lhs_entry = Value(result); } template @@ -197,7 +197,7 @@ void BytecodeInterpreter::unary_operation(Configuration& configuration) result = call_result; } dbgln_if(WASM_TRACE_DEBUG, "map({}) {} = {}", Operator::name(), *value, result); - configuration.stack().peek() = Value(result); + entry = Value(result); } template diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Configuration.cpp b/Userland/Libraries/LibWasm/AbstractMachine/Configuration.cpp index ff32e26f3f..0d238fe700 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/Configuration.cpp +++ b/Userland/Libraries/LibWasm/AbstractMachine/Configuration.cpp @@ -42,10 +42,8 @@ Result Configuration::call(Interpreter& interpreter, FunctionAddress address, Ve if (!function) return Trap {}; if (auto* wasm_function = function->get_pointer()) { - Vector locals; - locals.ensure_capacity(arguments.size() + wasm_function->code().locals().size()); - for (auto& value : arguments) - locals.append(Value { value }); + Vector locals = move(arguments); + locals.ensure_capacity(locals.size() + wasm_function->code().locals().size()); for (auto& type : wasm_function->code().locals()) locals.empend(type, 0ull);