aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/CtBehavior.java
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2005-03-02 03:42:10 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2005-03-02 03:42:10 +0000
commit13ecd1542cc38d7a4699006ad9d7471fa224be0b (patch)
treeb9bd4fa46eb167071e6b457a6f296a0931c87aa6 /src/main/javassist/CtBehavior.java
parentbf8c6f9ca9884e77b0ea328a7b49a008f7f84c39 (diff)
downloadjavassist-13ecd1542cc38d7a4699006ad9d7471fa224be0b.tar.gz
javassist-13ecd1542cc38d7a4699006ad9d7471fa224be0b.zip
fixed a bug of CtBehavior.insertAt (and a few other minor fixes)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@162 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/CtBehavior.java')
-rw-r--r--src/main/javassist/CtBehavior.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/javassist/CtBehavior.java b/src/main/javassist/CtBehavior.java
index 92759e6f..7bde7ae6 100644
--- a/src/main/javassist/CtBehavior.java
+++ b/src/main/javassist/CtBehavior.java
@@ -799,10 +799,12 @@ public abstract class CtBehavior extends CtMember {
jv.recordLocalVariables(ca, index);
jv.recordParams(getParameterTypes(),
Modifier.isStatic(getModifiers()));
+ jv.setMaxLocals(ca.getMaxLocals());
jv.compileStmnt(src);
Bytecode b = jv.getBytecode();
- int stack = b.getMaxStack();
int locals = b.getMaxLocals();
+ int stack = b.getMaxStack();
+ ca.setMaxLocals(locals);
/* We assume that there is no values in the operand stack
* at the position where the bytecode is inserted.
@@ -810,9 +812,6 @@ public abstract class CtBehavior extends CtMember {
if (stack > ca.getMaxStack())
ca.setMaxStack(stack);
- if (locals > ca.getMaxLocals())
- ca.setMaxLocals(locals);
-
iterator.insert(index, b.get());
iterator.insert(b.getExceptionTable(), index);
return lineNum;