From 41693f46d4e2de060d50b0fadf4e3eaecfcc4841 Mon Sep 17 00:00:00 2001 From: Roland Takacs Date: Tue, 3 Jan 2023 12:49:24 +0100 Subject: [PATCH] Use Compiler::Error as pointer Change-Id: Ic2e703547c1d578840f224964b98afe87fa23248 Signed-off-by: Roland Takacs --- runtime/js_eval.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/js_eval.cpp b/runtime/js_eval.cpp index 9db28f3fa..0dcfcb826 100644 --- a/runtime/js_eval.cpp +++ b/runtime/js_eval.cpp @@ -34,8 +34,9 @@ JSTaggedValue EvalUtils::GetEvaluatedScript(JSThread *thread, const JSHandleGetEcmaVM()->GetFactory(); if (!program) { - const auto &err = compiler.GetError(); - JSHandle error = objectFactory->GetJSError(ErrorType::SYNTAX_ERROR, err.Message().c_str()); + const auto *err = compiler.GetError(); + ASSERT(err != nullptr); + JSHandle error = objectFactory->GetJSError(ErrorType::SYNTAX_ERROR, err->Message().c_str()); THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error.GetTaggedValue(), JSTaggedValue::Exception()); } -- Gitee