Skip to content

Commit

Permalink
Handle methods with integer return types properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe12o committed Feb 4, 2014
1 parent 5106c38 commit 62de5d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/skcraft/alicefixes/util/ASMHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ private static MethodVisitor injectReturn(MethodVisitor mv, String returnType) {
mv.visitInsn(IRETURN);
} else if(returnType.equals("void")) {
mv.visitInsn(RETURN);
} else if(returnType.equals("int")) {
mv.visitInsn(ICONST_0);
mv.visitInsn(IRETURN);
} else {
//Not sure if this will turn out so well in every case...
mv.visitVarInsn(ALOAD, ACONST_NULL);
Expand Down

0 comments on commit 62de5d5

Please sign in to comment.