binaryen.js
binaryen.js copied to clipboard
addActiveElementSegment out of bound
by
console.log("e.table", e.table, data.length)
console.log("table", binaryen.getTableInfo(this.module.getTable(e.table)))
output
e.table 0 185325
table { name: '0', module: '', base: '', initial: 185326, max: 185326 }
we know table's capacity is 185326. data length is 185325.
then, call addActiveElementSegment
this.module.addActiveElementSegment(e.table, this.module.i32.const(0), data)
it is crash
RangeError: offset is out of bounds
at Int32Array.set (<anonymous>)
at H (file:///home/niu2x/project/wasm-knife/node_modules/binaryen/index.js:7:9932452)
at file:///home/niu2x/project/wasm-knife/node_modules/binaryen/index.js:7:9980342
at R (file:///home/niu2x/project/wasm-knife/node_modules/binaryen/index.js:7:9932359)
at HA.I.addActiveElementSegment (file:///home/niu2x/project/wasm-knife/node_modules/binaryen/index.js:7:9980289)