From 3dfd0b1949818bc34eac6c4f890a4972268a519e Mon Sep 17 00:00:00 2001 From: yang-19970325 Date: Wed, 19 Jul 2023 09:34:21 +0800 Subject: [PATCH] Fix cppcrash caused by evaluate fail Issue:#I7M6MN Signed-off-by: yang-19970325 Change-Id: Ifd4964dc90894c9f9a93a71dee7639768fa49911 --- ecmascript/debugger/debugger_api.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecmascript/debugger/debugger_api.cpp b/ecmascript/debugger/debugger_api.cpp index 2cf8524db1..0bd5737f26 100644 --- a/ecmascript/debugger/debugger_api.cpp +++ b/ecmascript/debugger/debugger_api.cpp @@ -684,6 +684,7 @@ void DebuggerApi::HandleUncaughtException(const EcmaVM *ecmaVm, std::string &mes const GlobalEnvConstants *globalConst = thread->GlobalConstants(); JSHandle exHandle(thread, thread->GetException()); + thread->ClearException(); if (exHandle->IsJSError()) { JSHandle nameKey = globalConst->GetHandledNameString(); JSHandle name(JSObject::GetProperty(thread, exHandle, nameKey).GetValue()); @@ -694,7 +695,6 @@ void DebuggerApi::HandleUncaughtException(const EcmaVM *ecmaVm, std::string &mes JSHandle ecmaStr = JSTaggedValue::ToString(thread, exHandle); message = ConvertToString(*ecmaStr); } - thread->ClearException(); } Local DebuggerApi::GenerateFuncFromBuffer(const EcmaVM *ecmaVm, const void *buffer,