diff --git a/lib/loader/index.js b/lib/loader/index.js index 014d1f39..f0a1e261 100644 --- a/lib/loader/index.js +++ b/lib/loader/index.js @@ -176,7 +176,7 @@ function postInstantiate(baseModule, instance) { const align = getAlign(VAL_ALIGN, info); const length = values.length; const buf = alloc(length << align, ARRAYBUFFER_ID); - const arr = alloc(ARRAYBUFFERVIEW_SIZE, id); + const arr = alloc(info & ARRAY ? ARRAY_SIZE : ARRAYBUFFERVIEW_SIZE, id); checkMem(); U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = retain(buf); U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2] = buf;