diff --git a/src/api/js/scripts/make-ts-wrapper.ts b/src/api/js/scripts/make-ts-wrapper.ts index 15652aa8e..560ad292e 100644 --- a/src/api/js/scripts/make-ts-wrapper.ts +++ b/src/api/js/scripts/make-ts-wrapper.ts @@ -461,13 +461,13 @@ export async function init(initModule: any, moduleOverrides: Record outUintArray[i]; - let outIntArray = (new Int32Array(Mod.HEAPU32.buffer, outAddress, 4)); + let outIntArray = (new Int32Array(Mod.HEAPU32.buffer, outAddress, ${BYTES_TO_ALLOCATE_FOR_OUT_PARAMS / 4})); let getOutInt = (i: ${getValidOutArrayIndexes(4)}) => outIntArray[i]; - let outUint64Array = (new BigUint64Array(Mod.HEAPU32.buffer, outAddress, 2)); + let outUint64Array = (new BigUint64Array(Mod.HEAPU32.buffer, outAddress, ${BYTES_TO_ALLOCATE_FOR_OUT_PARAMS / 8})); let getOutUint64 = (i: ${getValidOutArrayIndexes(8)}) => outUint64Array[i]; - let outInt64Array = (new BigInt64Array(Mod.HEAPU32.buffer, outAddress, 2)); + let outInt64Array = (new BigInt64Array(Mod.HEAPU32.buffer, outAddress, ${BYTES_TO_ALLOCATE_FOR_OUT_PARAMS / 8})); let getOutInt64 = (i: ${getValidOutArrayIndexes(8)}) => outInt64Array[i]; return {