mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix error in System.arraycopy
This commit is contained in:
parent
ad57f957cb
commit
25ceeb3af0
|
@ -47,15 +47,8 @@ public final class TSystem extends TObject {
|
||||||
}
|
}
|
||||||
if (srcType != targetType) {
|
if (srcType != targetType) {
|
||||||
if (!srcType.isPrimitive() && !targetType.isPrimitive()) {
|
if (!srcType.isPrimitive() && !targetType.isPrimitive()) {
|
||||||
Object[] srcArray = (Object[])(Object)src;
|
doArrayCopy(src, srcPos, dest, destPos, length);
|
||||||
Object[] dstArray = (Object[])(Object)dest;
|
return;
|
||||||
for (int i = 0; i < length; ++i) {
|
|
||||||
Object elem = srcArray[srcPos++];
|
|
||||||
if (!targetType.isInstance(elem)) {
|
|
||||||
throw new TArrayStoreException();
|
|
||||||
}
|
|
||||||
dstArray[destPos++] = elem;
|
|
||||||
}
|
|
||||||
} else if (!srcType.isPrimitive() || !targetType.isPrimitive()) {
|
} else if (!srcType.isPrimitive() || !targetType.isPrimitive()) {
|
||||||
throw new TArrayStoreException();
|
throw new TArrayStoreException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user