diff options
author | Stiver <stiver.mail@gmail.com> | 2014-07-28 20:13:30 +0200 |
---|---|---|
committer | Stiver <stiver.mail@gmail.com> | 2014-07-28 20:13:30 +0200 |
commit | 55beef6b7e5171c90c725e6fcdf48c9d248ff07e (patch) | |
tree | f721d65c1e6e3934fdc3d66557260a718bbb001b /src/de/fernflower/modules/decompiler/exps/InvocationExprent.java | |
parent | 7f116b6eb506080d552c71445737e444a065e7e1 (diff) | |
download | fernflower-55beef6b7e5171c90c725e6fcdf48c9d248ff07e.tar fernflower-55beef6b7e5171c90c725e6fcdf48c9d248ff07e.tar.gz fernflower-55beef6b7e5171c90c725e6fcdf48c9d248ff07e.tar.lz fernflower-55beef6b7e5171c90c725e6fcdf48c9d248ff07e.tar.xz fernflower-55beef6b7e5171c90c725e6fcdf48c9d248ff07e.zip |
Fixed 'IDEA-127301: NPE in decompiler' - a couple of issues with lambda processing
Diffstat (limited to 'src/de/fernflower/modules/decompiler/exps/InvocationExprent.java')
-rw-r--r-- | src/de/fernflower/modules/decompiler/exps/InvocationExprent.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/de/fernflower/modules/decompiler/exps/InvocationExprent.java b/src/de/fernflower/modules/decompiler/exps/InvocationExprent.java index 1e4c596..b4aeb0e 100644 --- a/src/de/fernflower/modules/decompiler/exps/InvocationExprent.java +++ b/src/de/fernflower/modules/decompiler/exps/InvocationExprent.java @@ -76,7 +76,7 @@ public class InvocationExprent extends Exprent { public InvocationExprent() {} - public InvocationExprent(int opcode, LinkConstant cn, ListStack<Exprent> stack) { + public InvocationExprent(int opcode, LinkConstant cn, ListStack<Exprent> stack, int dynamic_invokation_type) { name = cn.elementname; classname = cn.classname; @@ -99,6 +99,7 @@ public class InvocationExprent extends Exprent { classname = "java/lang/Class"; // dummy class name invoke_dynamic_classsuffix = "##Lambda_" + cn.index1 + "_" + cn.index2; + } if("<init>".equals(name)) { @@ -114,7 +115,13 @@ public class InvocationExprent extends Exprent { lstParameters.add(0, stack.pop()); } - if(opcode == CodeConstants.opc_invokestatic || opcode == CodeConstants.opc_invokedynamic) { + if(opcode == CodeConstants.opc_invokedynamic) { + if(dynamic_invokation_type == CodeConstants.CONSTANT_MethodHandle_REF_invokeStatic) { + isStatic = true; + } else { + instance = lstParameters.get(0); // FIXME: remove the first parameter completely from the list. It's the object type for a virtual lambda method. + } + } else if(opcode == CodeConstants.opc_invokestatic) { isStatic = true; } else { instance = stack.pop(); |