projects
/
org.ibex.classgen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow Type.Primitive as an arg to NEWARRAY
[org.ibex.classgen.git]
/
src
/
org
/
ibex
/
classgen
/
MethodGen.java
diff --git
a/src/org/ibex/classgen/MethodGen.java
b/src/org/ibex/classgen/MethodGen.java
index
5b0ba85
..
ef40595
100644
(file)
--- 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 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;
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 {
} 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");
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();
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");
else if (arg[i] != null) s = arg[i].toString();
if (s != null) sb.append(" ").append(s);
sb.append("\n");