summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/instruction_simplifier.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2017-12-04 11:27:47 +0000
committerVladimir Marko <vmarko@google.com>2017-12-04 11:52:21 +0000
commit0259c24f5e83ab69b259245b645076b864b2e2ca (patch)
tree20a12e5d7ac9c1bcbf8f4524583f016a53ae34ca /compiler/optimizing/instruction_simplifier.cc
parentdc93cac66f1db225474cec5bf0350fd7a148085e (diff)
downloadart-0259c24f5e83ab69b259245b645076b864b2e2ca.tar.gz
art-0259c24f5e83ab69b259245b645076b864b2e2ca.tar.bz2
art-0259c24f5e83ab69b259245b645076b864b2e2ca.zip
Fix a bug in String.charAt() simplification.
Do not pass method index as a bool flag indicating that the HBoundsCheck originates from a String.charAt(). This was working only thanks to the method index unlikely to be 0. This bug was introduced in https://android-review.googlesource.com/321573 . Test: Rely on TreeHugger. Bug: 30933338 Change-Id: I2a51e478ee145d342af8cd49f9fdec7adffd77ff
Diffstat (limited to 'compiler/optimizing/instruction_simplifier.cc')
-rw-r--r--compiler/optimizing/instruction_simplifier.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc
index bd20d28992..13c7607cbb 100644
--- a/compiler/optimizing/instruction_simplifier.cc
+++ b/compiler/optimizing/instruction_simplifier.cc
@@ -2276,7 +2276,7 @@ void InstructionSimplifierVisitor::SimplifyStringCharAt(HInvoke* invoke) {
HArrayLength* length = new (allocator) HArrayLength(str, dex_pc, /* is_string_length */ true);
invoke->GetBlock()->InsertInstructionBefore(length, invoke);
HBoundsCheck* bounds_check = new (allocator) HBoundsCheck(
- index, length, dex_pc, invoke->GetDexMethodIndex());
+ index, length, dex_pc, /* is_string_char_at */ true);
invoke->GetBlock()->InsertInstructionBefore(bounds_check, invoke);
HArrayGet* array_get = new (allocator) HArrayGet(str,
bounds_check,