From 3f1928aac1dbf58669197a44ccbf0c3b92ed7343 Mon Sep 17 00:00:00 2001 From: Chicken Bones Date: Thu, 26 Sep 2013 18:24:22 +1000 Subject: [PATCH] Fixed bug with double return types in ASM mixins --- codechicken/multipart/asm/ASMMixinCompiler.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codechicken/multipart/asm/ASMMixinCompiler.scala b/codechicken/multipart/asm/ASMMixinCompiler.scala index 59123d1..177b8ad 100644 --- a/codechicken/multipart/asm/ASMMixinCompiler.scala +++ b/codechicken/multipart/asm/ASMMixinCompiler.scala @@ -244,11 +244,12 @@ object ASMMixinCompiler def finishBridgeCall(mv:MethodVisitor, mvdesc:String, opcode:Int, owner:String, name:String, desc:String) { val args = getArgumentTypes(mvdesc) + val ret = getReturnType(mvdesc) for(i <- 0 until args.length) mv.visitVarInsn(args(i).getOpcode(ILOAD), i+1) mv.visitMethodInsn(opcode, owner, name, desc) - mv.visitInsn(getReturnType(mvdesc).getOpcode(IRETURN)) - mv.visitMaxs(width(args)+1, width(args)+1) + mv.visitInsn(ret.getOpcode(IRETURN)) + mv.visitMaxs(Math.max(width(args)+1, width(ret)), width(args)+1) } def writeBridge(mv:MethodVisitor, mvdesc:String, opcode:Int, owner:String, name:String, desc:String)