Fix NPE when decompiling constructor #654
This commit is contained in:
committed by
Egor Ushakov
parent
7c8e64da81
commit
a74a9d7d25
42
testData/src/pkg/TestMissingConstructorCallBad.jasm
Normal file
42
testData/src/pkg/TestMissingConstructorCallBad.jasm
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* This code can be assembled with <a href="https://wiki.openjdk.java.net/display/CodeTools/asmtools">asmtools</a>
|
||||
* using <code>asmtools jasm -g *.jasm</code> command line.
|
||||
*/
|
||||
package pkg;
|
||||
|
||||
super public class TestMissingConstructorCallBad
|
||||
version 52:0
|
||||
{
|
||||
|
||||
private Method "<init>":"()V"
|
||||
stack 2 locals 1
|
||||
{
|
||||
getstatic Field java/lang/System.out:"Ljava/io/PrintStream;";
|
||||
ldc String "Nobody will see what we do here!";
|
||||
invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
|
||||
|
||||
aload_0;
|
||||
aconst_null;
|
||||
invokespecial Method "<init>":"(Ljava/lang/Object;)V";
|
||||
return;
|
||||
}
|
||||
|
||||
public static varargs Method main:"([Ljava/lang/String;)V"
|
||||
stack 2 locals 2
|
||||
{
|
||||
try t0;
|
||||
new class TestMissingConstructorCallBad;
|
||||
dup;
|
||||
invokespecial Method "<init>":"()V";
|
||||
pop;
|
||||
endtry t0;
|
||||
goto L12;
|
||||
catch t0 java/lang/Throwable;
|
||||
stack_frame_type stack1;
|
||||
stack_map class java/lang/Throwable;
|
||||
astore_1;
|
||||
L12: stack_frame_type same;
|
||||
return;
|
||||
}
|
||||
|
||||
} // end Class TestMissingConstructorCallBad
|
||||
50
testData/src/pkg/TestMissingConstructorCallGood.jasm
Normal file
50
testData/src/pkg/TestMissingConstructorCallGood.jasm
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* This code can be assembled with <a href="https://wiki.openjdk.java.net/display/CodeTools/asmtools">asmtools</a>
|
||||
* using <code>asmtools jasm -g *.jasm</code> command line.
|
||||
*/
|
||||
package pkg;
|
||||
|
||||
super public class TestMissingConstructorCallGood
|
||||
version 52:0
|
||||
{
|
||||
|
||||
private Method "<init>":"(Ljava/lang/Object;)V"
|
||||
stack 1 locals 2
|
||||
{
|
||||
aload_0;
|
||||
invokespecial Method java/lang/Object."<init>":"()V";
|
||||
return;
|
||||
}
|
||||
|
||||
private Method "<init>":"()V"
|
||||
stack 2 locals 1
|
||||
{
|
||||
getstatic Field java/lang/System.out:"Ljava/io/PrintStream;";
|
||||
ldc String "Nobody will see what we do here!";
|
||||
invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
|
||||
|
||||
aload_0;
|
||||
aconst_null;
|
||||
invokespecial Method "<init>":"(Ljava/lang/Object;)V";
|
||||
return;
|
||||
}
|
||||
|
||||
public static varargs Method main:"([Ljava/lang/String;)V"
|
||||
stack 2 locals 2
|
||||
{
|
||||
try t0;
|
||||
new class TestMissingConstructorCallGood;
|
||||
dup;
|
||||
invokespecial Method "<init>":"()V";
|
||||
pop;
|
||||
endtry t0;
|
||||
goto L12;
|
||||
catch t0 java/lang/Throwable;
|
||||
stack_frame_type stack1;
|
||||
stack_map class java/lang/Throwable;
|
||||
astore_1;
|
||||
L12: stack_frame_type same;
|
||||
return;
|
||||
}
|
||||
|
||||
} // end Class TestMissingConstructorCallGood
|
||||
Reference in New Issue
Block a user