aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/expr
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/javassist/expr')
-rw-r--r--src/main/javassist/expr/ExprEditor.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/javassist/expr/ExprEditor.java b/src/main/javassist/expr/ExprEditor.java
index 9bba13b7..db9cb437 100644
--- a/src/main/javassist/expr/ExprEditor.java
+++ b/src/main/javassist/expr/ExprEditor.java
@@ -101,12 +101,21 @@ public class ExprEditor {
}
}
- // codeAttr might be modified by other partys
+ // codeAttr might be modified by other partiess
// so I check the current value of max-locals.
if (codeAttr.getMaxLocals() < context.maxLocals)
codeAttr.setMaxLocals(context.maxLocals);
codeAttr.setMaxStack(codeAttr.getMaxStack() + context.maxStack);
+ try {
+ if (edited)
+ minfo.rebuildStackMapIf6(clazz.getClassPool(),
+ clazz.getClassFile2());
+ }
+ catch (BadBytecode b) {
+ throw new CannotCompileException(b.getMessage(), b);
+ }
+
return edited;
}