diff --git a/runtime/interpreter/ecma-interpreter-inl.h b/runtime/interpreter/ecma-interpreter-inl.h index e7d0a922d0102c0a9c4ce1569ab97d72b1fb6c71..fdf95681650cf862ff9ab97d047d43d6c152e1b1 100644 --- a/runtime/interpreter/ecma-interpreter-inl.h +++ b/runtime/interpreter/ecma-interpreter-inl.h @@ -24,40 +24,44 @@ namespace panda::ecmascript { // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define INTRINSIC_CALL_SETACC(intrinsic_call) \ - { \ - JSTaggedValue result(intrinsic_call); \ - SetAccFromTaggedValue(result); \ +#define INTRINSIC_CALL_SETACC(intrinsic_call) \ + { \ + JSTaggedValue result(intrinsic_call); \ + ASSERT(!this->GetJSThread()->HasPendingException()); \ + SetAccFromTaggedValue(result); \ } // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define INTRINSIC_CALL_CHECK(intrinsic_call) \ - { \ - JSTaggedValue result(intrinsic_call); \ - if (UNLIKELY(result.IsException())) { \ - this->MoveToExceptionHandler(); \ - return; \ - } \ +#define INTRINSIC_CALL_CHECK(intrinsic_call) \ + { \ + JSTaggedValue result(intrinsic_call); \ + if (UNLIKELY(result.IsException())) { \ + this->MoveToExceptionHandler(); \ + return; \ + } \ + ASSERT(!this->GetJSThread()->HasPendingException()); \ } // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define INTRINSIC_CALL_CHECK_SETACC(intrinsic_call) \ - { \ - JSTaggedValue result(intrinsic_call); \ - if (UNLIKELY(result.IsException())) { \ - this->MoveToExceptionHandler(); \ - return; \ - } \ - SetAccFromTaggedValue(result); \ +#define INTRINSIC_CALL_CHECK_SETACC(intrinsic_call) \ + { \ + JSTaggedValue result(intrinsic_call); \ + if (UNLIKELY(result.IsException())) { \ + this->MoveToExceptionHandler(); \ + return; \ + } \ + ASSERT(!this->GetJSThread()->HasPendingException()); \ + SetAccFromTaggedValue(result); \ } // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define INTERPRETER_RETURN_IF_ABRUPT(result) \ - do { \ - if (result.IsException()) { \ - this->MoveToExceptionHandler(); \ - return; \ - } \ +#define INTERPRETER_RETURN_IF_ABRUPT(result) \ + do { \ + if (result.IsException()) { \ + this->MoveToExceptionHandler(); \ + return; \ + } \ + ASSERT(!this->GetJSThread()->HasPendingException()); \ } while (false) #define UPDATE_UNARY_ARITH_PROFILE(lhs) \ diff --git a/runtime/interpreter/slow_runtime_stub.cpp b/runtime/interpreter/slow_runtime_stub.cpp index f64d28f1ae2a34853b1f75de0216a2dad236e10b..3a3e9b3d0f93a27f9a81fe65119f2ff721f6e541 100644 --- a/runtime/interpreter/slow_runtime_stub.cpp +++ b/runtime/interpreter/slow_runtime_stub.cpp @@ -1434,7 +1434,10 @@ JSTaggedValue SlowRuntimeStub::ClassPrivateFieldGet(JSThread *thread, JSTaggedVa THROW_TYPE_ERROR_AND_RETURN(thread, "Private field was defined without a getter", JSTaggedValue::Exception()); } - return JSFunction::Call(thread, prop_desc.GetGetter(), obj_handle, 0, nullptr); + JSTaggedValue res = JSFunction::Call(thread, prop_desc.GetGetter(), obj_handle, 0, + nullptr); // TODO(vpukhov): return Exception on unwind + RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); + return res; } JSTaggedValue SlowRuntimeStub::ClassPrivateFieldSet(JSThread *thread, JSTaggedValue ctor, JSTaggedValue obj, @@ -1477,7 +1480,10 @@ JSTaggedValue SlowRuntimeStub::ClassPrivateFieldSet(JSThread *thread, JSTaggedVa InternalCallParams *params = thread->GetInternalCallParams(); params->MakeArgv(value_handle); - return JSFunction::Call(thread, prop_desc.GetSetter(), obj_handle, 1, params->GetArgv()); + JSTaggedValue res = JSFunction::Call(thread, prop_desc.GetSetter(), obj_handle, 1, + params->GetArgv()); // TODO(vpukhov): return Exception on unwind + RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); + return res; } JSTaggedValue SlowRuntimeStub::ClassPrivateFieldIn(JSThread *thread, JSTaggedValue ctor, JSTaggedValue obj,