Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addActiveElementSegment out of bound #96

Open
niu2x opened this issue Aug 4, 2024 · 1 comment
Open

addActiveElementSegment out of bound #96

niu2x opened this issue Aug 4, 2024 · 1 comment

Comments

@niu2x
Copy link

niu2x commented Aug 4, 2024

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)

@niu2x
Copy link
Author

niu2x commented Aug 4, 2024

when table's capacity is 2, i add one elem is correct.

it seems only crash when large.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant