From 412c4a042bda89074dad74cd67762e71b136b820 Mon Sep 17 00:00:00 2001 From: liujiahua Date: Thu, 30 Nov 2023 13:57:41 +0800 Subject: [PATCH] BugFix: Assertion failed in GetTaggedObject Insert RangeError throw out issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I8KMQS Signed-off-by: liujiahua Change-Id: Ifeb807831e99e9c2420f0dcbb21d2fedd74f30dc --- ecmascript/js_number_format.cpp | 2 +- ecmascript/object_factory-inl.h | 4 +--- test/moduletest/bigint/bigint.js | 9 ++++++++- test/moduletest/bigint/expect_output.txt | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ecmascript/js_number_format.cpp b/ecmascript/js_number_format.cpp index 3e533fe963..768ade5412 100644 --- a/ecmascript/js_number_format.cpp +++ b/ecmascript/js_number_format.cpp @@ -444,7 +444,7 @@ void JSNumberFormat::InitializeNumberFormat(JSThread *thread, const JSHandleGetFactory(); // 1. Let requestedLocales be ? CanonicalizeLocaleList(locales). JSHandle requestedLocales = intl::LocaleHelper::CanonicalizeLocaleList(thread, locales); - + RETURN_IF_ABRUPT_COMPLETION(thread); // 2. If options is undefined, then // a. Let options be ObjectCreate(null). // 3. Else, diff --git a/ecmascript/object_factory-inl.h b/ecmascript/object_factory-inl.h index 1b5735e556..c779c888c4 100644 --- a/ecmascript/object_factory-inl.h +++ b/ecmascript/object_factory-inl.h @@ -92,9 +92,7 @@ JSHandle ObjectFactory::NewJSNativePointer(void *externalPointe obj->SetNativeFlag(flag); if (callBack != nullptr) { - if (flag == NativeFlag::NO_DIV) { - heap_->IncreaseNativeBindingSize(nativeBindingsize); - } + heap_->IncreaseNativeBindingSize(nativeBindingsize); vm_->PushToNativePointerList(static_cast(header)); // In some cases, the size of JS/TS object is too small and the native binding size is too large. // Check and try trigger concurrent mark here. diff --git a/test/moduletest/bigint/bigint.js b/test/moduletest/bigint/bigint.js index ea83f88a98..148c94148d 100644 --- a/test/moduletest/bigint/bigint.js +++ b/test/moduletest/bigint/bigint.js @@ -92,4 +92,11 @@ hmap.set(c, '3'); hmap.set(d, '4'); hmap.forEach((val,key)=>{ print("hmap val:" + val, "key :" + key); -}) \ No newline at end of file +}) + +const v83 = new BigUint64Array(1096); +try { + v83["toLocaleString"]("toLocaleString", "toLocaleString"); +} catch (error) { + print(error); +} diff --git a/test/moduletest/bigint/expect_output.txt b/test/moduletest/bigint/expect_output.txt index bc647eaff6..22897a9252 100644 --- a/test/moduletest/bigint/expect_output.txt +++ b/test/moduletest/bigint/expect_output.txt @@ -23,3 +23,4 @@ SyntaxError 0 map val:4 key :9007199254740991 hmap val:4 key :9007199254740991 +RangeError: invalid locale