diff --git a/ecmascript/interpreter/interpreter-inl.cpp b/ecmascript/interpreter/interpreter-inl.cpp index 3feb40a88491f7c9a246a5738ce0f27160570dd5..cad8a71595a8d9b2af96d19042ead9a9b684d954 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 9b13b9f3dff2c48edb7dee60b2b3b50719dd1ae0..ac2d69798830fa1278272a64d5605007e970f26b 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);