summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_sinking.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2020-05-14 14:51:11 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2020-05-14 19:15:01 +0100
commit33c091eaaa0febedc93cff820def75b122fde867 (patch)
treecbbe7369f8206af3180a9530bcd1729042cdd544 /compiler/optimizing/code_sinking.cc
parent5d2311a349f208f056b33da8fc9c950aad1a7ffe (diff)
Code sinking can move around LoadString that can throw.
The test accidentally used a string part of the boot image, which means we know the instruction won't throw. However, a change in the boot classpath meant the string "a" was not part of the boot image anymore, and the test started failing. The CL now handles the case the LoadString might throw, and treat it like NewInstance/NewArray. Test: 672-checker-throw-method, 673-checker-throw-vmethod Bug: 156559242 Change-Id: If9df2ed2c7c39c56254970172e315ec5113db64e
Diffstat (limited to 'compiler/optimizing/code_sinking.cc')
-rw-r--r--compiler/optimizing/code_sinking.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/optimizing/code_sinking.cc b/compiler/optimizing/code_sinking.cc
index f406983fc2..f946e5031a 100644
--- a/compiler/optimizing/code_sinking.cc
+++ b/compiler/optimizing/code_sinking.cc
@@ -58,8 +58,8 @@ static bool IsInterestingInstruction(HInstruction* instruction) {
}
}
- // Check allocations first, as they can throw, but it is safe to move them.
- if (instruction->IsNewInstance() || instruction->IsNewArray()) {
+ // Check allocations and strings first, as they can throw, but it is safe to move them.
+ if (instruction->IsNewInstance() || instruction->IsNewArray() || instruction->IsLoadString()) {
return true;
}