ccebinger / SWPSoSe14

2 stars 1 forks source link

add cast from obj to integer to bytecode generator #156

Closed Zelldon closed 10 years ago

Zelldon commented 10 years ago
    Integer a = 5;
    Object b = a;

    Integer c = (Integer) b;
Compiled from "JavaByteCode.java"
public class javabytecode.JavaByteCode {
  public javabytecode.JavaByteCode();
    Code:
       0: aload_0       
       1: invokespecial #1                  // Method java/lang/Object."":()V
       4: return        
  public static void main(java.lang.String[]);
    Code:
       0: iconst_5      
       1: invokestatic  #2                  // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       4: astore_1      
       5: aload_1       
       6: astore_2      
       7: aload_2       
       8: checkcast     #3                  // class java/lang/Integer
      11: astore_3      
      12: return        
}
Zelldon commented 10 years ago

done