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
50ff3af
..
ef40595
100644
(file)
--- a/
src/org/ibex/classgen/MethodGen.java
+++ b/
src/org/ibex/classgen/MethodGen.java
@@
-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");