diff --git a/src/machine.cpp b/src/machine.cpp index 67f70196fe..964bfd5452 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -4889,7 +4889,10 @@ populateMultiArray(Thread* t, object array, int32_t* counts, PROTECT(t, class_); for (int32_t i = 0; i < counts[index]; ++i) { - object a = makeArray(t, counts[index + 1]); + object a = makeArray + (t, ceiling + (counts[index + 1] * classArrayElementSize(t, class_), BytesPerWord)); + arrayLength(t, a) = counts[index + 1]; setObjectClass(t, a, class_); set(t, array, ArrayBody + (i * BytesPerWord), a); diff --git a/test/Floats.java b/test/Floats.java index 2e869a9a87..723b899a1a 100644 --- a/test/Floats.java +++ b/test/Floats.java @@ -260,5 +260,17 @@ public class Floats { int result = Float.floatToIntBits(number); expect(result == orig); } + + for (int x = 0; x < 1000; ++x) { + int m = 100; + int n = 200; + double array[][] = new double[m][n]; + + for (int i = 0; i < m; ++i) { + for (int j = 0; j < n; ++j) { + array[i][j] = 1234567890.0; + } + } + } } }