X-Git-Url: http://git.megacz.com/?p=org.ibex.classgen.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fclassgen%2FMethodGen.java;h=ef40595c82287c4be889e97590ec72c3023c970f;hp=5b0ba8554f06a6e9d6fbed2708ba6c61fc311f28;hb=ddf408851103280fd02c37c7afd806a94b2a3ec3;hpb=505ea0c18222ad300c6886dece45c6c0a2790856 diff --git a/src/org/ibex/classgen/MethodGen.java b/src/org/ibex/classgen/MethodGen.java index 5b0ba85..ef40595 100644 --- a/src/org/ibex/classgen/MethodGen.java +++ b/src/org/ibex/classgen/MethodGen.java @@ -15,8 +15,8 @@ public class MethodGen extends Type.Class.Method.Body { private final Vector exnTable = new Vector(); private final Hashtable thrownExceptions = new Hashtable(); - private int maxStack = 16; - private int maxLocals; + int maxStack = 16; + int maxLocals; private int size; private int capacity; @@ -842,7 +842,9 @@ public class MethodGen extends Type.Class.Method.Body { } else if (argLength == 7) { throw new Error("should never happen - variable length instruction not explicitly handled"); } else { - int iarg = ((Integer)arg).intValue(); + int iarg = (arg instanceof Type.Primitive) + ? ((Type.Primitive)arg).toArraySpec() + : ((Integer)arg).intValue(); if (argLength == 1) { if ((opdata & OP_UNSIGNED_FLAG) != 0 ? iarg >= 256 : (iarg < -128 || iarg >= 128)) throw new ClassFile.Exn("overflow of s/u1 option"); @@ -998,7 +1000,7 @@ public class MethodGen extends Type.Class.Method.Body { String s = null; if (arg[i] instanceof Type) s = ((Type)arg[i]).toString(); else if (arg[i] instanceof Type.Class.Member) s = ((Type.Class.Member)arg[i]).toString(); - else if (arg[i] instanceof String) s = "\"" + s + "\""; + else if (arg[i] instanceof String) s = "\"" + arg[i] + "\""; else if (arg[i] != null) s = arg[i].toString(); if (s != null) sb.append(" ").append(s); sb.append("\n");