From 62de5d5d2aba6ad5f2aef16429a81814f248fb7e Mon Sep 17 00:00:00 2001 From: Joe12o Date: Tue, 4 Feb 2014 16:59:30 -0500 Subject: [PATCH] Handle methods with integer return types properly. --- src/main/java/com/skcraft/alicefixes/util/ASMHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/skcraft/alicefixes/util/ASMHelper.java b/src/main/java/com/skcraft/alicefixes/util/ASMHelper.java index 327168c..a528894 100644 --- a/src/main/java/com/skcraft/alicefixes/util/ASMHelper.java +++ b/src/main/java/com/skcraft/alicefixes/util/ASMHelper.java @@ -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);