Sat, 14 Sep 2013 19:04:47 +0100
7047734: javac, the LVT is not generated correctly in several scenarios
Reviewed-by: jjg, mcimadamore
aoqi@0 | 1 | /* /nodynamiccopyright/ */ |
aoqi@0 | 2 | |
aoqi@0 | 3 | public class TestCaseIf { |
aoqi@0 | 4 | |
aoqi@0 | 5 | @AliveRange(varName="o", bytecodeStart=9, bytecodeLength=5) |
aoqi@0 | 6 | @AliveRange(varName="o", bytecodeStart=17, bytecodeLength=1) |
aoqi@0 | 7 | void m0(String[] args) { |
aoqi@0 | 8 | Object o; |
aoqi@0 | 9 | if (args[0] != null) { |
aoqi@0 | 10 | o = ""; |
aoqi@0 | 11 | o.hashCode(); |
aoqi@0 | 12 | } |
aoqi@0 | 13 | o = ""; |
aoqi@0 | 14 | } |
aoqi@0 | 15 | |
aoqi@0 | 16 | @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=5) |
aoqi@0 | 17 | @AliveRange(varName="o", bytecodeStart=18, bytecodeLength=1) |
aoqi@0 | 18 | void m1() { |
aoqi@0 | 19 | Object o; |
aoqi@0 | 20 | int i = 5; |
aoqi@0 | 21 | if (i == 5) { |
aoqi@0 | 22 | o = ""; |
aoqi@0 | 23 | o.hashCode(); |
aoqi@0 | 24 | } |
aoqi@0 | 25 | o = ""; |
aoqi@0 | 26 | } |
aoqi@0 | 27 | |
aoqi@0 | 28 | @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=5) |
aoqi@0 | 29 | @AliveRange(varName="o", bytecodeStart=18, bytecodeLength=1) |
aoqi@0 | 30 | void m2() { |
aoqi@0 | 31 | Object o; |
aoqi@0 | 32 | int i = 5; |
aoqi@0 | 33 | if (!(i == 5)) { |
aoqi@0 | 34 | o = ""; |
aoqi@0 | 35 | o.hashCode(); |
aoqi@0 | 36 | } |
aoqi@0 | 37 | o = ""; |
aoqi@0 | 38 | } |
aoqi@0 | 39 | |
aoqi@0 | 40 | @AliveRange(varName="o", bytecodeStart=15, bytecodeLength=5) |
aoqi@0 | 41 | @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=1) |
aoqi@0 | 42 | void m3(String[] args) { |
aoqi@0 | 43 | Object o; |
aoqi@0 | 44 | if (args[0] != null && args[1] != null) { |
aoqi@0 | 45 | o = ""; |
aoqi@0 | 46 | o.hashCode(); |
aoqi@0 | 47 | } |
aoqi@0 | 48 | o = ""; |
aoqi@0 | 49 | } |
aoqi@0 | 50 | |
aoqi@0 | 51 | @AliveRange(varName="o", bytecodeStart=15, bytecodeLength=5) |
aoqi@0 | 52 | @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=1) |
aoqi@0 | 53 | void m4(String[] args) { |
aoqi@0 | 54 | Object o; |
aoqi@0 | 55 | if (args[0] != null || args[1] != null) { |
aoqi@0 | 56 | o = ""; |
aoqi@0 | 57 | o.hashCode(); |
aoqi@0 | 58 | } |
aoqi@0 | 59 | o = ""; |
aoqi@0 | 60 | } |
aoqi@0 | 61 | } |