From ef0a0f214b1c41640de79f427505bdb88eb6d1ea Mon Sep 17 00:00:00 2001 From: hoenicke Date: Fri, 15 Dec 2000 10:59:25 +0000 Subject: [PATCH] Reserve locals for method arguments. Important if they are not accessed afterwards. git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1280 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/bytecode/BytecodeInfo.java.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jode/jode/bytecode/BytecodeInfo.java.in b/jode/jode/bytecode/BytecodeInfo.java.in index b098753..025700a 100644 --- a/jode/jode/bytecode/BytecodeInfo.java.in +++ b/jode/jode/bytecode/BytecodeInfo.java.in @@ -957,7 +957,9 @@ public class BytecodeInfo extends BinaryInfo implements Opcodes { /* Recalculate addr, length, maxStack, maxLocals and add all * constants to gcp */ int addr = 0; - maxLocals = 0; + maxLocals = (methodInfo.isStatic() ? 0 : 1) + + TypeSignature.getArgumentSize(methodInfo.getType()); + for (Iterator iter = instructions.iterator(); iter.hasNext(); ) { Instruction instr = (Instruction) iter.next(); int opcode = instr.getOpcode();