Fix JNEW-ARRAY-FROM-ARRAY to create byte[] arrays.

parent 07dbb903
......@@ -709,7 +709,14 @@ public final class Java
LispObject v = args[1];
for (int i = 2; i<args.length - 1; i++)
a = Array.get(a, ((Integer)args[i].javaInstance()).intValue());
Array.set(a, ((Integer)args[args.length - 1].javaInstance()).intValue(), v.javaInstance());
Object value = v.javaInstance();
int index = ((Integer)args[args.length - 1].javaInstance()).intValue();
if (value instanceof java.lang.Number
&& a.getClass().getComponentType().equals(Byte.TYPE)) {
Array.setByte(a, index, ((java.lang.Number)value).byteValue());
} else {
Array.set(a, index, value);
}
return v;
}
catch (Throwable t) { // no code -> no ControlTransfer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment