diff options
author | Ian Rogers <irogers@google.com> | 2014-07-07 23:53:08 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-07-08 17:30:29 -0700 |
commit | ebbdd87cbb57e45da341fbf7325406e982810c10 (patch) | |
tree | fc8c236a7fd44ad040e013c549822868a777b747 /test/052-verifier-fun/src | |
parent | 751dee376dcd972af996106a4c32ab4964c1f867 (diff) | |
download | art-ebbdd87cbb57e45da341fbf7325406e982810c10.zip art-ebbdd87cbb57e45da341fbf7325406e982810c10.tar.gz art-ebbdd87cbb57e45da341fbf7325406e982810c10.tar.bz2 |
Only allow instance-of to improve knowledge of a type for downcasts.
Previous "not upcast" test could improve a type to an impossible type that
following a merge back with the original register would lead to conflict
(and subsequent verifier errors).
Modify UpdateRegisters so that the work line will be updated if merging
causes changes in the fall-through case.
Bug: 15808277
Issue: https://code.google.com/p/android/issues/detail?id=72093
Change-Id: Ib16cae8506246177e902825af036d5a397ad0dac
Diffstat (limited to 'test/052-verifier-fun/src')
-rw-r--r-- | test/052-verifier-fun/src/Main.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/052-verifier-fun/src/Main.java b/test/052-verifier-fun/src/Main.java index 0168412..3ffd143 100644 --- a/test/052-verifier-fun/src/Main.java +++ b/test/052-verifier-fun/src/Main.java @@ -24,6 +24,7 @@ public class Main { tryBlah(1); System.out.println("Zorch."); + System.out.println("10 == " + instanceOfTest(10)); } /* @@ -120,4 +121,15 @@ public class Main { feature.doStuff(); } + + static int instanceOfTest(Integer x) { + Object y = x; + if (y instanceof String) { + // Bug: 15808277 + // Non-sensical instance-of to check merging after the branch doesn't result in a verifier + // error. + ((String)y).charAt(0); + } + return x.intValue(); + } } |