aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2013-04-13 17:27:52 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2013-04-13 17:27:52 +0000
commitfc4e2231b33404adea225df5a931db62619b1b12 (patch)
tree39262e0ff07e59c72f42240da5b59ea00f9959a9 /src/main/javassist/bytecode
parentd5500a2a6f5703f10a703ad6498e28c52c367104 (diff)
downloadjavassist-fc4e2231b33404adea225df5a931db62619b1b12.tar.gz
javassist-fc4e2231b33404adea225df5a931db62619b1b12.zip
fixed JASSIST-190
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@703 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/bytecode')
-rw-r--r--src/main/javassist/bytecode/stackmap/MapMaker.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main/javassist/bytecode/stackmap/MapMaker.java b/src/main/javassist/bytecode/stackmap/MapMaker.java
index 9777ca20..e0aa5dac 100644
--- a/src/main/javassist/bytecode/stackmap/MapMaker.java
+++ b/src/main/javassist/bytecode/stackmap/MapMaker.java
@@ -18,6 +18,7 @@ package javassist.bytecode.stackmap;
import java.util.ArrayList;
import javassist.ClassPool;
+import javassist.CtClass;
import javassist.NotFoundException;
import javassist.bytecode.*;
@@ -205,8 +206,14 @@ public class MapMaker extends Tracer {
{
while (handler != null) {
TypedBlock tb = (TypedBlock)handler.body;
- if (tb.alreadySet())
+ if (tb.alreadySet()) {
mergeMap(tb, false);
+ if (tb.stackTop < 1)
+ throw new BadBytecode("bad catch clause: " + handler.typeIndex);
+
+ tb.stackTypes[0] = merge(toExceptionType(handler.typeIndex),
+ tb.stackTypes[0]);
+ }
else {
recordStackMap(tb, handler.typeIndex);
MapMaker maker = new MapMaker(this);
@@ -256,14 +263,18 @@ public class MapMaker extends Tracer {
throws BadBytecode
{
TypeData[] tStackTypes = TypeData.make(stackTypes.length);
+ tStackTypes[0] = toExceptionType(exceptionType).join();
+ recordStackMap0(target, 1, tStackTypes);
+ }
+
+ private TypeData.ClassName toExceptionType(int exceptionType) {
String type;
if (exceptionType == 0) // for finally clauses
- type = "java.lang.Throwable";
+ type= "java.lang.Throwable";
else
type = cpool.getClassInfo(exceptionType);
- tStackTypes[0] = new TypeData.ClassName(type);
- recordStackMap0(target, 1, tStackTypes);
+ return new TypeData.ClassName(type);
}
private void recordStackMap0(TypedBlock target, int st, TypeData[] tStackTypes)