From c38d3187c7682816eb6df53775911a006dd1d60d Mon Sep 17 00:00:00 2001 From: jiangmengyang Date: Wed, 13 Aug 2025 15:51:39 +0800 Subject: [PATCH] disable dynaimc import ut test with c interpreter Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/ICSRJN Signed-off-by: jiangmengyang Change-Id: Ib6131dc825e6a66af0769aaf52560252a653f400 --- .../tests/builtins_promise_job_test.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ecmascript/builtins/tests/builtins_promise_job_test.cpp b/ecmascript/builtins/tests/builtins_promise_job_test.cpp index 451949373c..c3179a47e9 100644 --- a/ecmascript/builtins/tests/builtins_promise_job_test.cpp +++ b/ecmascript/builtins/tests/builtins_promise_job_test.cpp @@ -61,6 +61,15 @@ Local BuiltinsPromiseJobTest::MockGetModuleJSError(JsiRuntimeCallInf // dynamic import static module after load 1.0 module failed HWTEST_F_L0(BuiltinsPromiseJobTest, DynamicImportJobCatchException) { + /** + * Both the handle and the stack are allocated using maloc. + * When newJsError is called, the C interpreter will step back one frame before executing. + * In the UT, there is only one frame, and stepping back causes it to step on the handle address. + * This is a special scenario caused by the UT, and it would not occur during normal execution. + */ + if (!thread->IsAsmInterpreter()) { + return; + } auto vm = thread->GetEcmaVM(); ObjectFactory *factory = vm->GetFactory(); JSHandle env = vm->GetGlobalEnv(); @@ -111,6 +120,15 @@ HWTEST_F_L0(BuiltinsPromiseJobTest, DynamicImportJobCatchException) // throw 1.2 load failed HWTEST_F_L0(BuiltinsPromiseJobTest, DynamicImportJobCatchException2) { + /** + * Both the handle and the stack are allocated using maloc. + * When newJsError is called, the C interpreter will step back one frame before executing. + * In the UT, there is only one frame, and stepping back causes it to step on the handle address. + * This is a special scenario caused by the UT, and it would not occur during normal execution. + */ + if (!thread->IsAsmInterpreter()) { + return; + } auto vm = thread->GetEcmaVM(); ObjectFactory *factory = vm->GetFactory(); JSHandle env = vm->GetGlobalEnv(); -- Gitee