diff --git a/runtime/global_dictionary-inl.h b/runtime/global_dictionary-inl.h index ca6f553ee065ad82cf9e0e69b956cc6b1ac03e05..566c062c2235945c809e383656e120bc6bb61198 100644 --- a/runtime/global_dictionary-inl.h +++ b/runtime/global_dictionary-inl.h @@ -55,7 +55,7 @@ PropertyBox *GlobalDictionary::GetSafeBox(int entry) const if (!val.IsHeapObject()) { return nullptr; } - return PropertyBox::Cast(Get(index).GetTaggedObject()); + return PropertyBox::Cast(val.GetTaggedObject()); } JSTaggedValue GlobalDictionary::GetValue(int entry) const diff --git a/runtime/js_eval.cpp b/runtime/js_eval.cpp index 4ce5155b2470c91016ee4af7608de1851ea9b96e..2936f822bada3adf75084b668aba7edcb977cace 100644 --- a/runtime/js_eval.cpp +++ b/runtime/js_eval.cpp @@ -56,6 +56,15 @@ JSTaggedValue EvalUtils::GetEvaluatedScript(JSThread *thread, const JSHandleGetInvocableFunction(*pandaFile, "func_main_0"); ASSERT(resolveFunc.HasValue()); + JSHandle func(thread, resolveFunc.Value()); + // For DirectEval, functions in envirement and in arguments are different. + // Compiled code use function form the parameter for creating envirement. + // So we temporary disable compilation for eval calls. + auto method = func->GetCallTarget(); + ASSERT(method->GetCompilationStatus() == Method::NOT_COMPILED); + method->AtomicSetCompilationStatus(Method::NOT_COMPILED, Method::FAILED); + ASSERT(method->GetCompilationStatus() == Method::FAILED); + return resolveFunc.Value(); }