Exception not thrown!

issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I9G8GB

Signed-off-by: jiachong <jiachong6@huawei.com>
Change-Id: I1badcc30f5f71f3a724cb1a52bd23356c07246de
This commit is contained in:
jiachong 2024-04-16 19:56:30 +08:00
parent 05e9c703ec
commit d476d2c4f6
3 changed files with 25 additions and 1 deletions

View File

@ -339,6 +339,7 @@ JSTaggedValue BuiltinsFunction::FunctionPrototypeToString(EcmaRuntimeCallInfo *a
if (method->IsNativeWithCallField()) {
JSHandle<JSTaggedValue> nameKey = thread->GlobalConstants()->GetHandledNameString();
JSHandle<EcmaString> methodName(JSObject::GetProperty(thread, thisValue, nameKey).GetValue());
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
std::string nameStr = EcmaStringAccessor(methodName).ToStdString();
std::string startStr = "function ";
std::string endStr = "() { [native code] }";

View File

@ -13,3 +13,4 @@
stack overflow!
15000
stack overflow success

View File

@ -36,4 +36,26 @@ try {
if ((e instanceof RangeError)) {
print("stack overflow!");
}
}
}
function runNearStackLimit(f) {
function t() {
try {
t();
} catch (e) {
f();
}
};
try {
t();
} catch (e) {
}
}
const v3 = new Proxy(Boolean, []);
const v4 = v3.bind();
function f5(a6, a7) {
4294967296n + v4;
return runNearStackLimit(f5);
}
f5();
print("stack overflow success");