diff options
author | chibash <chiba@javassist.org> | 2015-05-28 09:41:41 +0900 |
---|---|---|
committer | chibash <chiba@javassist.org> | 2015-05-28 09:41:41 +0900 |
commit | a4f46cd3a9445b7c90b8d8b029f069b4db1a342e (patch) | |
tree | 40d6b4dc5b61ac7e5c9fc1a60030622a92cc2054 /src/main/javassist/compiler | |
parent | 6dc421894d4ab8f981c45cd88de853fb86fed8bf (diff) | |
download | javassist-a4f46cd3a9445b7c90b8d8b029f069b4db1a342e.tar.gz javassist-a4f46cd3a9445b7c90b8d8b029f069b4db1a342e.zip |
fixed JASSIST-242
Diffstat (limited to 'src/main/javassist/compiler')
-rw-r--r-- | src/main/javassist/compiler/MemberCodeGen.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/javassist/compiler/MemberCodeGen.java b/src/main/javassist/compiler/MemberCodeGen.java index f799eea0..67031992 100644 --- a/src/main/javassist/compiler/MemberCodeGen.java +++ b/src/main/javassist/compiler/MemberCodeGen.java @@ -568,9 +568,6 @@ public class MemberCodeGen extends CodeGen { // generate code for evaluating arguments. atMethodArgs(args, types, dims, cnames); - // used by invokeinterface - int count = bytecode.getStackDepth() - stack + 1; - if (found == null) found = resolver.lookupMethod(targetClass, thisClass, thisMethod, mname, types, dims, cnames); @@ -587,12 +584,12 @@ public class MemberCodeGen extends CodeGen { } atMethodCallCore2(targetClass, mname, isStatic, isSpecial, - aload0pos, count, found); + aload0pos, found); } private void atMethodCallCore2(CtClass targetClass, String mname, boolean isStatic, boolean isSpecial, - int aload0pos, int count, + int aload0pos, MemberResolver.Method found) throws CompileError { @@ -651,8 +648,10 @@ public class MemberCodeGen extends CodeGen { || declClass.isInterface() != targetClass.isInterface()) declClass = targetClass; - if (declClass.isInterface()) - bytecode.addInvokeinterface(declClass, mname, desc, count); + if (declClass.isInterface()) { + int nargs = Descriptor.paramSize(desc) + 1; + bytecode.addInvokeinterface(declClass, mname, desc, nargs); + } else if (isStatic) throw new CompileError(mname + " is not static"); |