From 7255248783267c95813b37967c1e9ca34720ec53 Mon Sep 17 00:00:00 2001 From: sandee Date: Thu, 28 Aug 2025 20:36:04 +0800 Subject: [PATCH] Fix not callable exception cppcrash in debug mode Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/ICV3F3 Signed-off-by: sandee Change-Id: I4a9e96461dba736f69196e4a5e3176e3002ae8cf --- ecmascript/interpreter/interpreter-inl.cpp | 2 +- ecmascript/stubs/runtime_stubs.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ecmascript/interpreter/interpreter-inl.cpp b/ecmascript/interpreter/interpreter-inl.cpp index 3feb40a884..cad8a71595 100644 --- a/ecmascript/interpreter/interpreter-inl.cpp +++ b/ecmascript/interpreter/interpreter-inl.cpp @@ -929,7 +929,7 @@ void EcmaInterpreter::MethodEntry(JSThread *thread) continue; } Method *method = frameHandler.GetMethod(); - if (method->IsNativeWithCallField()) { + if (JSTaggedValue::Cast(method).IsUndefined() || method->IsNativeWithCallField()) { continue; } JSTaggedValue env = frameHandler.GetEnv(); diff --git a/ecmascript/stubs/runtime_stubs.cpp b/ecmascript/stubs/runtime_stubs.cpp index 9b13b9f3df..ac2d697988 100644 --- a/ecmascript/stubs/runtime_stubs.cpp +++ b/ecmascript/stubs/runtime_stubs.cpp @@ -2474,7 +2474,7 @@ DEF_RUNTIME_STUBS(MethodEntry) JSHandle func = GetHArg(argv, argc, 0); // 0: means the zeroth parameter if (func.GetTaggedValue().IsECMAObject()) { Method *method = ECMAObject::Cast(func.GetTaggedValue().GetTaggedObject())->GetCallTarget(thread); - if (method->IsNativeWithCallField()) { + if (JSTaggedValue::Cast(method).IsUndefined() || method->IsNativeWithCallField()) { return JSTaggedValue::Hole().GetRawData(); } JSHandle funcObj = JSHandle::Cast(func); -- Gitee