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

Empty use abort declaration triggers asc assertion since 0.9.3 #1176

Closed
jeffcharles opened this issue Mar 16, 2020 · 1 comment
Closed

Empty use abort declaration triggers asc assertion since 0.9.3 #1176

jeffcharles opened this issue Mar 16, 2020 · 1 comment

Comments

@jeffcharles
Copy link
Contributor

When I call asc with --use abort= as documented in https://docs.assemblyscript.org/details/debugging#overriding-abort, I see:

➜  mar16 npx asc src/mar16.ts -b build/mar16.wasm --sourceMap --validate --optimize --use abort= --runtime none --lib=node_modules 
ERROR: AssertionError: assertion failed
    at assert (/Users/jeffreycharles/scripts/mar16/node_modules/assemblyscript/dist/webpack:/assemblyscript/std/portable/index.js:184:9)
    at g.initialize (/Users/jeffreycharles/scripts/mar16/node_modules/assemblyscript/dist/webpack:/assemblyscript/src/program.ts:1007:22)
    at Object.t.initializeProgram (/Users/jeffreycharles/scripts/mar16/node_modules/assemblyscript/dist/webpack:/assemblyscript/src/index.ts:221:11)
    at /Users/jeffreycharles/scripts/mar16/node_modules/assemblyscript/cli/asc.js:595:22
    at measure (/Users/jeffreycharles/scripts/mar16/node_modules/assemblyscript/cli/asc.js:1103:3)
    at Object.main (/Users/jeffreycharles/scripts/mar16/node_modules/assemblyscript/cli/asc.js:594:26)
    at /Users/jeffreycharles/scripts/mar16/node_modules/assemblyscript/bin/asc:21:47

It looks like src/program.ts on line 1007 has let name = assert(globalAliases.get(alias)); and globalAliases has a key called abort which has a value of '' which is falsey in JavaScript which causes the assert to fire.

@DuncanUszkay1
Copy link
Contributor

Going to look into this

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

3 participants