mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-29 08:52:15 +00:00
fix potential oob
This commit is contained in:
parent
c34ed66fd9
commit
4b841efed2
@ -176,7 +176,7 @@ function postInstantiate(baseModule, instance) {
|
|||||||
const align = getAlign(VAL_ALIGN, info);
|
const align = getAlign(VAL_ALIGN, info);
|
||||||
const length = values.length;
|
const length = values.length;
|
||||||
const buf = alloc(length << align, ARRAYBUFFER_ID);
|
const buf = alloc(length << align, ARRAYBUFFER_ID);
|
||||||
const arr = alloc(ARRAYBUFFERVIEW_SIZE, id);
|
const arr = alloc(info & ARRAY ? ARRAY_SIZE : ARRAYBUFFERVIEW_SIZE, id);
|
||||||
checkMem();
|
checkMem();
|
||||||
U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = retain(buf);
|
U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = retain(buf);
|
||||||
U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2] = buf;
|
U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2] = buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user