Andreas Gampe | 891dfaa | 2015-07-13 21:12:43 -0700 | [diff] [blame] | 1 | .class public LB22411633_2; |
| 2 | .super Ljava/lang/Object; |
| 3 | |
| 4 | |
| 5 | .method public static run(Z)V |
| 6 | .registers 6 |
| 7 | # Make v3 & v4 defined, just use null. |
| 8 | const v3, 0 |
| 9 | const v4, 0 |
| 10 | |
| 11 | # Allocate a java.lang.Object (do not initialize). |
| 12 | new-instance v4, Ljava/lang/Object; |
| 13 | |
| 14 | # Branch forward. |
| 15 | if-eqz v5, :LabelMerge |
| 16 | |
| 17 | # Create a non-precise object reference. We can do this by merging to objects together |
| 18 | # that only have Object as a common ancestor. |
| 19 | |
| 20 | # Allocate a java.lang.Object and initialize it. |
| 21 | new-instance v4, Ljava/lang/Object; |
| 22 | invoke-direct {v4}, Ljava/lang/Object;-><init>()V |
| 23 | |
| 24 | if-nez v5, :LabelMergeObject |
| 25 | |
| 26 | new-instance v4, Ljava/lang/Integer; |
| 27 | invoke-direct {v4}, Ljava/lang/Integer;-><init>()V |
| 28 | |
| 29 | :LabelMergeObject |
| 30 | |
| 31 | # Dummy work to separate blocks. At this point, v4 is of type Reference<Object>. |
| 32 | add-int/lit16 v3, v3, 1 |
| 33 | |
| 34 | :LabelMerge |
| 35 | # Merge the uninitialized Object from line 12 with the reference to Object from 31. Older |
| 36 | # rules set any reference merged with Object to Object. This is wrong in the case of the |
| 37 | # other reference being an uninitialized reference, as we'd suddenly allow calling on it. |
| 38 | |
| 39 | # Test whether it's some initialized reference by calling hashCode. This should fail, as we |
| 40 | # merged initialized and uninitialized. |
| 41 | invoke-virtual {v4}, Ljava/lang/Object;->hashCode()I |
| 42 | |
| 43 | return-void |
| 44 | |
| 45 | .end method |