Fix simplifier issue with predicated ifield get
In cases where all targets of a HPredicatedInstanceFieldGet
instruction are known to not be null the simplifier would attempt to
replace the default value with a null instruction. This would cause a
null-pointer dereference. Correct the simplifier to handle this case
correctly.
Moved some LSE test helper functions to CommonCompilerTestHelper to
avoid duplicating code.
Fixed an incorrect (though until now unused) constructor for
HPredicatatedInstanceFieldGet (the default value and target we
swapped).
Test: ./test.py --host
Test: ./art/tools/compile_jars.py --profile-file bad-compile.txt ~/imgur.apk
Bug: 183942773
Change-Id: I66f4ce37d768d5e457047a3f80bd4cb9aa4546a3
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index c47ca3b..48dae87 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -6245,8 +6245,8 @@
field_idx,
declaring_class_def_index,
dex_file) {
- SetRawInputAt(0, value);
- SetRawInputAt(1, default_value);
+ SetRawInputAt(1, value);
+ SetRawInputAt(0, default_value);
}
bool IsClonable() const override {