mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-30 13:40:51 +00:00
回退 'Pull Request !5071 : 回退 'Pull Request !5059 : Check stackoverflow before entering asm interpreter''
This commit is contained in:
parent
bde42db2ee
commit
16c80aee29
@ -650,6 +650,17 @@ JSTaggedValue EcmaInterpreter::Execute(EcmaRuntimeCallInfo *info)
|
||||
JSThread *thread = info->GetThread();
|
||||
INTERPRETER_TRACE(thread, Execute);
|
||||
if (thread->IsAsmInterpreter()) {
|
||||
// check stack overflow before re-enter asm interpreter
|
||||
if (UNLIKELY(thread->GetCurrentStackPosition() < thread->GetStackLimit())) {
|
||||
LOG_ECMA(ERROR) << "Stack overflow! current:" << thread->GetCurrentStackPosition()
|
||||
<< " limit:" << thread->GetStackLimit();
|
||||
if (LIKELY(!thread->HasPendingException())) {
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
JSHandle<JSObject> error = factory->GetJSError(base::ErrorType::RANGE_ERROR, "Stack overflow!", false);
|
||||
thread->SetException(error.GetTaggedValue());
|
||||
}
|
||||
return thread->GetException();
|
||||
}
|
||||
return InterpreterAssembly::Execute(info);
|
||||
}
|
||||
#ifndef EXCLUDE_C_INTERPRETER
|
||||
|
Loading…
Reference in New Issue
Block a user