Merge pull request #989 from jmbockhorst/fix-descendants-of-type

Web bindings: fix descendantsOfType memory allocation
This commit is contained in:
Max Brunsfeld 2021-03-13 21:55:12 -08:00 committed by GitHub
commit f3910c649e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -362,7 +362,7 @@ class Node {
}
// Copy the array of symbols to the WASM heap.
const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.count);
const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.length);
for (let i = 0, n = symbols.length; i < n; i++) {
setValue(symbolsAddress + i * SIZE_OF_INT, symbols[i], 'i32');
}