mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
fix element spec calculation for multidimensional primitive arrays
The element class for e.g. [[[I should be [[I, not [I.
This commit is contained in:
parent
023787d121
commit
8995db69d2
@ -2510,10 +2510,13 @@ makeArrayClass(Thread* t, object loader, object spec, bool throw_,
|
||||
default:
|
||||
if (dimensions > 1) {
|
||||
char c = *s;
|
||||
elementSpec = makeByteArray(t, 3);
|
||||
byteArrayBody(t, elementSpec, 0) = '[';
|
||||
byteArrayBody(t, elementSpec, 1) = c;
|
||||
byteArrayBody(t, elementSpec, 2) = 0;
|
||||
elementSpec = makeByteArray(t, dimensions + 1);
|
||||
unsigned i;
|
||||
for (i = 0; i < dimensions - 1; ++i) {
|
||||
byteArrayBody(t, elementSpec, i) = '[';
|
||||
}
|
||||
byteArrayBody(t, elementSpec, i++) = c;
|
||||
byteArrayBody(t, elementSpec, i) = 0;
|
||||
-- dimensions;
|
||||
} else {
|
||||
abort(t);
|
||||
|
Loading…
Reference in New Issue
Block a user