diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2004-07-27 09:45:50 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2004-07-27 09:45:50 +0000 |
commit | af2793e73182bb4f61084d97a62852c6c155dac2 (patch) | |
tree | 67b5b7bbe2bc78bdddce0550363de377d03dbe67 /src/main/javassist/CtConstructor.java | |
parent | fedf39720fa22fab916ee254aaac6137c7469e09 (diff) | |
download | javassist-af2793e73182bb4f61084d97a62852c6c155dac2.tar.gz javassist-af2793e73182bb4f61084d97a62852c6c155dac2.zip |
fixed Bugs item #997458: addCatch("return;", ...) on CtConstructor causes VerifyError
implemented CtBehavior#addLocalVariable()
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@118 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/CtConstructor.java')
-rw-r--r-- | src/main/javassist/CtConstructor.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/javassist/CtConstructor.java b/src/main/javassist/CtConstructor.java index e294ca51..72dcee11 100644 --- a/src/main/javassist/CtConstructor.java +++ b/src/main/javassist/CtConstructor.java @@ -284,4 +284,18 @@ public final class CtConstructor extends CtBehavior { throw new CannotCompileException(e); } } + + /* This method is called by addCatch() in CtBehavior. + * super() and this() must not be in a try statement. + */ + int getStartPosOfBody(CodeAttribute ca) throws CannotCompileException { + CodeIterator ci = ca.iterator(); + try { + ci.skipConstructor(); + return ci.next(); + } + catch (BadBytecode e) { + throw new CannotCompileException(e); + } + } } |