mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix copying memory blocks
This commit is contained in:
parent
26749150f6
commit
9fd5a87a00
|
@ -110,9 +110,9 @@ public final class Example {
|
|||
byte[] negatives = new byte[100];
|
||||
for (int i = 0; i < array.length; ++i) {
|
||||
array[i] = (byte) i;
|
||||
negatives[i] = (byte) -i;
|
||||
negatives[i] = (byte) (-i - 1);
|
||||
}
|
||||
System.arraycopy(negatives, 4, array, 0, 12);
|
||||
System.arraycopy(negatives, 0, array, 4, 12);
|
||||
System.arraycopy(negatives, 1, array, 21, 12);
|
||||
System.arraycopy(negatives, 2, array, 35, 12);
|
||||
System.arraycopy(negatives, 1, array, 8, 3);
|
||||
|
|
|
@ -262,14 +262,14 @@ public final class WasmRuntime {
|
|||
alignedTargetStart.putInt(alignedSourceStart.getInt());
|
||||
break;
|
||||
case 1:
|
||||
alignedTargetStart.add(3).putByte(alignedSourceStart.add(3).getByte());
|
||||
alignedTargetStart.add(1).putByte(alignedSourceStart.add(1).getByte());
|
||||
alignedTargetStart.add(2).putShort(alignedSourceStart.add(2).getShort());
|
||||
break;
|
||||
case 2:
|
||||
alignedTargetStart.add(2).putShort(alignedSourceStart.add(2).getShort());
|
||||
break;
|
||||
case 3:
|
||||
alignedTargetStart.add(1).putByte(alignedSourceStart.add(1).getByte());
|
||||
alignedTargetStart.add(2).putShort(alignedSourceStart.add(2).getShort());
|
||||
alignedTargetStart.add(3).putByte(alignedSourceStart.add(3).getByte());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ public final class WasmRuntime {
|
|||
alignedTargetStart = alignedTargetStart.add(4);
|
||||
}
|
||||
|
||||
switch (source.getInt() + count - alignedSourceEnd.getInt()) {
|
||||
switch (source.toInt() + count - alignedSourceEnd.toInt()) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
|
@ -297,7 +297,7 @@ public final class WasmRuntime {
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
switch (source.getInt() + count - alignedSourceEnd.getInt()) {
|
||||
switch (source.toInt() + count - alignedSourceEnd.toInt()) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
|
@ -312,7 +312,7 @@ public final class WasmRuntime {
|
|||
break;
|
||||
}
|
||||
|
||||
while (alignedSourceEnd.toInt() > alignedTargetEnd.toInt()) {
|
||||
while (alignedSourceEnd.toInt() > alignedSourceStart.toInt()) {
|
||||
alignedTargetEnd.putInt(alignedSourceEnd.getInt());
|
||||
alignedSourceEnd = alignedSourceEnd.add(-4);
|
||||
alignedTargetEnd = alignedTargetEnd.add(-4);
|
||||
|
|
Loading…
Reference in New Issue
Block a user