Skip to content

Empty use abort declaration triggers asc assertion since 0.9.3 #1176

Closed

Description

@jeffcharles

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.

Activity

  1. DuncanUszkay1 commented on Mar 16, 2020

    @DuncanUszkay1
    Contributor

    Going to look into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions