[nterp] Export PC before overwiting it in op_aput_object.
Test: run cts -m vm-tests-tf -t dot.junit.opcodes.Test_aput_object#testN4
Bug: 160182704
Change-Id: Ifa3d29024085d8f33ae466453f298fa709c41e93
diff --git a/runtime/interpreter/mterp/arm64ng/array.S b/runtime/interpreter/mterp/arm64ng/array.S
index 81e3d90..b596bfb 100644
--- a/runtime/interpreter/mterp/arm64ng/array.S
+++ b/runtime/interpreter/mterp/arm64ng/array.S
@@ -58,7 +58,7 @@
/*
* Array put. vBB[vCC] <- vAA.
*
- * for: aput, aput-boolean, aput-byte, aput-char, aput-short, aput-wide
+ * for: aput, aput-boolean, aput-byte, aput-char, aput-short, aput-wide, aput-object
*
*/
FETCH_B w2, 1, 0 // w2<- BB
@@ -73,6 +73,9 @@
.endif
cmp w1, w3 // compare unsigned index, length
bcs common_errArrayIndex // index >= length, bail
+ .if $is_object
+ EXPORT_PC // Export PC before overwriting it.
+ .endif
FETCH_ADVANCE_INST 2 // advance rPC, load rINST
.if $wide
GET_VREG_WIDE x2, w9 // x2<- vAA
@@ -82,7 +85,6 @@
.if $wide
$store x2, [x0, #$data_offset] // vBB[vCC]<- x2
.elseif $is_object
- EXPORT_PC
bl art_quick_aput_obj
.else
$store w2, [x0, #$data_offset] // vBB[vCC]<- w2