From: chibash Date: Sun, 25 Aug 2013 17:46:32 +0000 (+0900) Subject: fixed JASSIST-205 X-Git-Tag: rel_3_18_1_ga~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2f1ab1e1d16a56005b194e703efd1b05da906125;p=javassist.git fixed JASSIST-205 --- diff --git a/Readme.html b/Readme.html index 8910b4e6..0e877ccc 100644 --- a/Readme.html +++ b/Readme.html @@ -283,7 +283,7 @@ see javassist.Dump.

-version 3.19

diff --git a/javassist.jar b/javassist.jar index e9840d5e..f3ef43a3 100644 Binary files a/javassist.jar and b/javassist.jar differ diff --git a/src/main/javassist/bytecode/stackmap/MapMaker.java b/src/main/javassist/bytecode/stackmap/MapMaker.java index b1aa7008..a9ff1e08 100644 --- a/src/main/javassist/bytecode/stackmap/MapMaker.java +++ b/src/main/javassist/bytecode/stackmap/MapMaker.java @@ -228,7 +228,8 @@ public class MapMaker extends Tracer { private void mergeMap(TypedBlock dest, boolean mergeStack) throws BadBytecode { int n = localsTypes.length; for (int i = 0; i < n; i++) - dest.localsTypes[i] = merge(localsTypes[i], dest.localsTypes[i]); + dest.localsTypes[i] = merge(validateTypeData(localsTypes, n, i), + dest.localsTypes[i]); if (mergeStack) { n = stackTop; @@ -290,7 +291,8 @@ public class MapMaker extends Tracer { protected static int recordTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes) { int k = -1; for (int i = 0; i < n; i++) { - TypeData t = srcTypes[i]; + // TypeData t = srcTypes[i]; + TypeData t = validateTypeData(srcTypes, n, i); destTypes[i] = t.join(); if (t != TOP) k = i + 1; // t might be long or double. @@ -304,6 +306,15 @@ public class MapMaker extends Tracer { destTypes[i] = srcTypes[i]; } + private static TypeData validateTypeData(TypeData[] data, int length, int index) { + TypeData td = data[index]; + if (td.is2WordType() && index + 1 < length) + if (data[index + 1] != TOP) + return TOP; + + return td; + } + // Phase 1.5 /* diff --git a/src/main/javassist/bytecode/stackmap/TypeData.java b/src/main/javassist/bytecode/stackmap/TypeData.java index 363aa241..66199927 100644 --- a/src/main/javassist/bytecode/stackmap/TypeData.java +++ b/src/main/javassist/bytecode/stackmap/TypeData.java @@ -157,6 +157,7 @@ public abstract class TypeData { protected ArrayList usedBy; // reverse relations of lowers protected ArrayList uppers; // upper bounds of this type. protected String fixedType; + private boolean is2WordType; // cache public TypeVar(TypeData t) { uppers = null; @@ -164,6 +165,7 @@ public abstract class TypeData { usedBy = new ArrayList(2); merge(t); fixedType = null; + is2WordType = t.is2WordType(); } public String getName() { @@ -181,8 +183,10 @@ public abstract class TypeData { } public boolean is2WordType() { - if (fixedType == null) - return ((TypeData)lowers.get(0)).is2WordType(); + if (fixedType == null) { + return is2WordType; + // return ((TypeData)lowers.get(0)).is2WordType(); + } else return false; } @@ -319,6 +323,7 @@ public abstract class TypeData { TypeVar cv = (TypeVar)scc.get(i); cv.lowers.clear(); cv.lowers.add(kind); + is2WordType = kind.is2WordType(); } } else {