summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/mips/int_mips.cc
diff options
context:
space:
mode:
authorDouglas Leung <douglas.leung@imgtec.com>2015-07-02 16:42:08 -0700
committerRoland Levillain <rpl@google.com>2015-07-03 17:29:27 +0100
commitccbbda2b716bcc0dd9ad7b6c7bf9079efa3fca23 (patch)
tree52b01bc48dadce390c2e4ceffacdc16f674d3dd0 /compiler/dex/quick/mips/int_mips.cc
parent3abd437507f8ba30a238a52c273c9944dcb9d5a1 (diff)
downloadandroid_art-ccbbda2b716bcc0dd9ad7b6c7bf9079efa3fca23.tar.gz
android_art-ccbbda2b716bcc0dd9ad7b6c7bf9079efa3fca23.tar.bz2
android_art-ccbbda2b716bcc0dd9ad7b6c7bf9079efa3fca23.zip
Add implicit null pointer and stack overflow checks for Mips.
(cherry picked from commit 22bb5a2ebc1e2724179faf4660b2735dcb185f21) Bug: 21555893 Change-Id: I2a995be128a5603d08753c14956dd8c8240ac63c
Diffstat (limited to 'compiler/dex/quick/mips/int_mips.cc')
-rw-r--r--compiler/dex/quick/mips/int_mips.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/dex/quick/mips/int_mips.cc b/compiler/dex/quick/mips/int_mips.cc
index f5ad7c7c33..1099303f7d 100644
--- a/compiler/dex/quick/mips/int_mips.cc
+++ b/compiler/dex/quick/mips/int_mips.cc
@@ -691,6 +691,9 @@ void MipsMir2Lir::GenArrayGet(int opt_flags, OpSize size, RegLocation rl_array,
reg_len = AllocTemp();
// Get len.
Load32Disp(rl_array.reg, len_offset, reg_len);
+ MarkPossibleNullPointerException(opt_flags);
+ } else {
+ ForceImplicitNullCheck(rl_array.reg, opt_flags, false);
}
// reg_ptr -> array data.
OpRegRegImm(kOpAdd, reg_ptr, rl_array.reg, data_offset);
@@ -781,6 +784,9 @@ void MipsMir2Lir::GenArrayPut(int opt_flags, OpSize size, RegLocation rl_array,
// NOTE: max live temps(4) here.
// Get len.
Load32Disp(rl_array.reg, len_offset, reg_len);
+ MarkPossibleNullPointerException(opt_flags);
+ } else {
+ ForceImplicitNullCheck(rl_array.reg, opt_flags, false);
}
// reg_ptr -> array data.
OpRegImm(kOpAdd, reg_ptr, data_offset);