【修复】解决运行abc文件时,函数 BigIntHelper::RightTruncate出现断言错误

Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I82X60
Signed-off-by: chenlincl3 <chenlin201@huawei.com>
Change-Id: Iefec681254a1916fa68309f8ea33c132f3c6d95e
This commit is contained in:
chenlincl3 2023-09-25 11:22:16 +08:00
parent 9bbd871e0c
commit 05e3ba42d7
3 changed files with 24 additions and 1 deletions

View File

@ -775,6 +775,9 @@ JSTaggedValue NumberHelper::StringToBigInt(JSThread *thread, JSHandle<JSTaggedVa
}
buffer += *p;
} while (++p != end);
if (buffer.size() == 0) {
return BigInt::Uint32ToBigInt(thread, 0).GetTaggedValue();
}
return BigIntHelper::SetBigInt(thread, buffer, radix).GetTaggedValue();
}

View File

@ -50,4 +50,23 @@ try {
atom.and(new BigInt64Array(3807), atom, atom);
} catch (err) {
print(err.name)
}
}
const v33 = String.fromCharCode(48).padStart(48, String.fromCharCode(48));
const v35 = [-1073741824, 2, -9007199254740992];
const v42 = Symbol.toPrimitive;
Symbol.for(v42.description);
function f36(a37, a38) {
try {
a37.lastIndexOf(0);
} catch (err) {
print(err);
}
return v33;
}
v35[v42] = f36;
let v49 = -12n;
v49--;
const v52 = (v49 >> v49).constructor;
const t48 = v52.__defineSetter__;
print(v52(v35));

View File

@ -20,3 +20,4 @@ RangeError
0
RangeError
SyntaxError
0