Fix bug in optimizing around instanceof.
We were too aggressive when removing instanceof. We should
not remove it when there is one of the two static types that
is an interface.
Change-Id: I1fd80915b99b094f7b4393e7adb2b160201b30d5
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc
index 98a5841..2daeeb3 100644
--- a/compiler/optimizing/instruction_simplifier.cc
+++ b/compiler/optimizing/instruction_simplifier.cc
@@ -206,7 +206,9 @@
// The test failed at compile time so will also fail at runtime.
*outcome = false;
return true;
- } else if (!class_rti.IsInterface() && !obj_rti.IsSupertypeOf(class_rti)) {
+ } else if (!class_rti.IsInterface()
+ && !obj_rti.IsInterface()
+ && !obj_rti.IsSupertypeOf(class_rti)) {
// Different type hierarchy. The test will fail.
*outcome = false;
return true;