From bd62c4763c3396ddd3525ab30267b733274d2bfd Mon Sep 17 00:00:00 2001 From: Simon Wanner Date: Mon, 30 Oct 2023 11:03:17 +0100 Subject: [PATCH] LibJS/JIT: Flip saved_return_value condition in ContinuePendingUnwind MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This did not match the `if (saved_return_value) return else resume` in Interpreter. test/built-ins/Promise/all/resolve-poisoned-then.js ❌ -> ✅ test/built-ins/Promise/all/resolve-thenable.js ❌ -> ✅ test/built-ins/Promise/allSettled/resolve-poisoned-then.js ❌ -> ✅ test/built-ins/Promise/allSettled/resolve-thenable.js ❌ -> ✅ test/built-ins/Promise/race/resolve-self.js ❌ -> ✅ test/language/statements/try/S12.14_A7_T1.js ✅ -> ❌ test/language/statements/try/S12.14_A7_T2.js ✅ -> ❌ test/language/statements/try/S12.14_A7_T3.js ✅ -> ❌ --- Userland/Libraries/LibJS/JIT/Compiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/JIT/Compiler.cpp b/Userland/Libraries/LibJS/JIT/Compiler.cpp index 87e620dda4..1abf747d9e 100644 --- a/Userland/Libraries/LibJS/JIT/Compiler.cpp +++ b/Userland/Libraries/LibJS/JIT/Compiler.cpp @@ -1042,12 +1042,12 @@ void Compiler::compile_continue_pending_unwind(Bytecode::Op::ContinuePendingUnwi // re-throw the exception if we reached the end of the finally block and there was no catch block to handle it check_exception(); - // if (!saved_return_value.is_empty()) goto resume_block; + // if (saved_return_value.is_empty()) goto resume_block; load_vm_register(GPR0, Bytecode::Register::saved_return_value()); m_assembler.mov(Assembler::Operand::Register(GPR1), Assembler::Operand::Imm(Value().encoded())); m_assembler.jump_if( Assembler::Operand::Register(GPR0), - Assembler::Condition::NotEqualTo, + Assembler::Condition::EqualTo, Assembler::Operand::Register(GPR1), label_for(op.resume_target().block()));