From 5e76f2b19760e2a509ad860475aa76f27e2767ee Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 9 Apr 1999 08:02:21 +0000 Subject: [PATCH] make param locals ourself, number them continously git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@530 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/CodeAnalyzer.java | 41 +++++++++++++++++++++----- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/jode/jode/decompiler/CodeAnalyzer.java b/jode/jode/decompiler/CodeAnalyzer.java index 351cbae..db3a185 100644 --- a/jode/jode/decompiler/CodeAnalyzer.java +++ b/jode/jode/decompiler/CodeAnalyzer.java @@ -22,6 +22,8 @@ import jode.*; import jode.bytecode.*; import jode.flow.FlowBlock; import jode.flow.TransformExceptionHandlers; +import jode.jvm.CodeVerifier; +import jode.jvm.VerifyException; import java.util.BitSet; import java.util.Stack; @@ -48,7 +50,7 @@ public class CodeAnalyzer implements Analyzer { */ public MethodAnalyzer getMethod() {return method;} - public CodeAnalyzer(MethodAnalyzer ma, + public CodeAnalyzer(MethodAnalyzer ma, MethodInfo minfo, AttributeInfo codeattr, JodeEnvironment e) { method = ma; @@ -65,6 +67,14 @@ public class CodeAnalyzer implements Analyzer { code = null; return; } + CodeVerifier verifier + = new CodeVerifier(getClazz(), minfo, code); + try { + verifier.verify(); + } catch (VerifyException ex) { + ex.printStackTrace(); + throw new jode.AssertError("Verification error"); + } if (Decompiler.useLVT) { AttributeInfo attr = code.findAttribute("LocalVariableTable"); @@ -74,11 +84,22 @@ public class CodeAnalyzer implements Analyzer { lvt = new LocalVariableTable(code.getMaxLocals(), cpool, attr); } } + initParams(); + } - int paramCount = method.getParamCount(); + public void initParams() { + Type[] paramTypes = method.getType().getParameterTypes(); + int paramCount = (method.isStatic() ? 0 : 1) + paramTypes.length; param = new LocalInfo[paramCount]; - for (int i=0; i