mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
Fix ldobjbyvalue crash in aot code when array is undefined
Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAD9CG Signed-off-by: c00513733 <chenqiuyao@huawei.com> Change-Id: If66e24f7d77d4b4b6547dc5c336bed3a2cc0a11d
This commit is contained in:
parent
9baa81aedc
commit
8742a10cb2
@ -407,6 +407,7 @@ void TypedHCRLowering::LowerTypedArrayCheck(GateRef gate)
|
||||
GateRef frameState = GetFrameState(gate);
|
||||
GateRef glueGlobalEnv = builder_.GetGlobalEnv();
|
||||
GateRef receiver = acc_.GetValueIn(gate, 0);
|
||||
builder_.HeapObjectCheck(receiver, frameState);
|
||||
GateRef receiverHClass = builder_.LoadHClass(receiver);
|
||||
GateRef rootHclass = builder_.GetGlobalEnvObj(glueGlobalEnv, typedArrayRootHclassIndex);
|
||||
GateRef rootOnHeapHclass = builder_.GetGlobalEnvObj(glueGlobalEnv, typedArrayRootHclassOnHeapIndex);
|
||||
|
@ -13,3 +13,4 @@
|
||||
|
||||
number
|
||||
boolean
|
||||
testTypedArrayUsedAsUndefined success
|
||||
|
@ -30,3 +30,18 @@ let b = new B(1);
|
||||
b.x = 1 < 2
|
||||
print(typeof b.x)
|
||||
|
||||
function callback(a1, a2, a3, a4) {
|
||||
a4[a2] &= 1;
|
||||
const arr2 = new Array(a3);
|
||||
try {
|
||||
arr2.find(callback);
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
function testTypedArrayUsedAsUndefined() {
|
||||
const arr = new Float32Array(20);
|
||||
arr.reduceRight(callback);
|
||||
print("testTypedArrayUsedAsUndefined success");
|
||||
}
|
||||
|
||||
testTypedArrayUsedAsUndefined();
|
Loading…
Reference in New Issue
Block a user