From 19cae4fa08769abf4437d767772b406d494255d8 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 8 Mar 2020 19:44:00 +0000 Subject: [PATCH] Pass StructMethod to processBlock() This will allow us to get at the OriginalPcTable. --- .../java/decompiler/main/rels/MethodProcessorRunnable.java | 2 +- .../java/decompiler/modules/decompiler/ExprProcessor.java | 7 ++++--- .../decompiler/modules/decompiler/FinallyProcessor.java | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/rels/MethodProcessorRunnable.java b/src/org/jetbrains/java/decompiler/main/rels/MethodProcessorRunnable.java index 726d747..a992b20 100644 --- a/src/org/jetbrains/java/decompiler/main/rels/MethodProcessorRunnable.java +++ b/src/org/jetbrains/java/decompiler/main/rels/MethodProcessorRunnable.java @@ -131,7 +131,7 @@ public class MethodProcessorRunnable implements Runnable { ClearStructHelper.clearStatements(root); ExprProcessor proc = new ExprProcessor(md, varProc); - proc.processStatement(root, cl); + proc.processStatement(root, mt, cl); SequenceHelper.condenseSequences(root); diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java index d4a02c4..dc8e0e7 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java @@ -15,6 +15,7 @@ import org.jetbrains.java.decompiler.modules.decompiler.sforms.FlattenStatements import org.jetbrains.java.decompiler.modules.decompiler.stats.*; import org.jetbrains.java.decompiler.modules.decompiler.vars.VarProcessor; import org.jetbrains.java.decompiler.struct.StructClass; +import org.jetbrains.java.decompiler.struct.StructMethod; import org.jetbrains.java.decompiler.struct.attr.StructBootstrapMethodsAttribute; import org.jetbrains.java.decompiler.struct.attr.StructGeneralAttribute; import org.jetbrains.java.decompiler.struct.consts.ConstantPool; @@ -102,7 +103,7 @@ public class ExprProcessor implements CodeConstants { varProcessor = varProc; } - public void processStatement(RootStatement root, StructClass cl) { + public void processStatement(RootStatement root, StructMethod mt, StructClass cl) { FlattenStatementsHelper flatthelper = new FlattenStatementsHelper(); DirectGraph dgraph = flatthelper.buildDirectGraph(root); @@ -151,7 +152,7 @@ public class ExprProcessor implements CodeConstants { BasicBlockStatement block = node.block; if (block != null) { - processBlock(block, data, cl); + processBlock(block, data, mt, cl); block.setExprents(data.getLstExprents()); } @@ -266,7 +267,7 @@ public class ExprProcessor implements CodeConstants { } } - public void processBlock(BasicBlockStatement stat, PrimitiveExprsList data, StructClass cl) { + public void processBlock(BasicBlockStatement stat, PrimitiveExprsList data, StructMethod mt, StructClass cl) { ConstantPool pool = cl.getPool(); StructBootstrapMethodsAttribute bootstrap = cl.getAttribute(StructGeneralAttribute.ATTRIBUTE_BOOTSTRAP_METHODS); diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java index e88c9d7..83e8bb9 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java @@ -138,7 +138,7 @@ public class FinallyProcessor { } ExprProcessor proc = new ExprProcessor(methodDescriptor, varProcessor); - proc.processStatement(root, mt.getClassStruct()); + proc.processStatement(root, mt, mt.getClassStruct()); SSAConstructorSparseEx ssa = new SSAConstructorSparseEx(); ssa.splitVariables(root, mt);