From 446ed412ef0a2f8789da75195a27b47f88ea2412 Mon Sep 17 00:00:00 2001 From: xing-yunhao Date: Fri, 19 Jul 2024 09:54:58 +0800 Subject: [PATCH] Bug fix: pr8053 ark_js_vm crash Fixed a bug causing ark_js_vm crash on phone In js_runtime_options.h, new options in enum CommandValues should be added at the bottom and the assertiong should not be modified Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAE2EG?from=project-issue Signed-off-by: xing-yunhao Change-Id: I3ca8e5d42bf991b32ee06413c67ca4ab069da30a --- compiler_service/include/aot_compiler_constants.h | 1 + ecmascript/js_runtime_options.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler_service/include/aot_compiler_constants.h b/compiler_service/include/aot_compiler_constants.h index 7004492df7..5ee363fbb4 100644 --- a/compiler_service/include/aot_compiler_constants.h +++ b/compiler_service/include/aot_compiler_constants.h @@ -78,6 +78,7 @@ std::unordered_set AotArgsSet { "compiler-opt-value-numbering", "compiler-opt-new-value-numbering", "compiler-opt-inlining", + "compiler-try-catch-function", "compiler-opt-pgotype", "compiler-opt-track-field", "entry-point", diff --git a/ecmascript/js_runtime_options.h b/ecmascript/js_runtime_options.h index ed6db3a97a..89e01a4e69 100644 --- a/ecmascript/js_runtime_options.h +++ b/ecmascript/js_runtime_options.h @@ -127,7 +127,6 @@ enum CommandValues { OPTION_COMPILER_OPT_STRING, OPTION_COMPILER_OPT_VALUE_NUMBERING, OPTION_COMPILER_OPT_INLINING, - OPTION_COMPILER_TRY_CATCH_FUNCTION, OPTION_COMPILER_OPT_PGOTYPE, OPTION_COMPILER_OPT_TRACK_FIELD, OPTION_COMPILER_PGO_PROFILER_PATH, @@ -198,8 +197,9 @@ enum CommandValues { OPTION_COMPILER_BASELINE_PGO, OPTION_ASYNC_LOAD_ABC, OPTION_PGO_TRACE, + OPTION_COMPILER_TRY_CATCH_FUNCTION, }; -static_assert(OPTION_SPLIT_ONE == 65); +static_assert(OPTION_SPLIT_ONE == 64); // add new option at the bottom, DO NOT modify this value class PUBLIC_API JSRuntimeOptions { public: