diff --git a/runtime/compiler/ecmascript_runtime_interface.cpp b/runtime/compiler/ecmascript_runtime_interface.cpp index fddc273ab335b8df52988a84626765eb921d168f..a732d2c38285bbd3f3c19904986e8899e115dee1 100644 --- a/runtime/compiler/ecmascript_runtime_interface.cpp +++ b/runtime/compiler/ecmascript_runtime_interface.cpp @@ -68,6 +68,10 @@ uintptr_t EcmaRuntimeInterface::GetGlobalVarAddress(MethodPtr method, size_t id) auto func = [&](Program *p) { constant_pool = p->GetConstantPool(); }; ecma_vm_->EnumerateProgram(func, panda_file->GetFilename()); + if (constant_pool.IsUndefined()) { + return 0; + } + ASSERT(!constant_pool.IsHole()); JSTaggedValue key = ConstantPool::Cast(constant_pool.GetHeapObject())->GetObjectFromCache(id);