Skip to content

compiler crash when using --use #2225

Closed
@HerrCai0907

Description

@HerrCai0907

// builtin.ts

export function abort(message: string | null, fileName: string | null, lineNumber: u32, columnNumber: u32): void {
}

// index.ts

export function add(a: i32, b: i32): i32 {
  abort(null, null, 0, 0);
  return 0;
}

// asconfig

{
  "targets": {
    "debug": {
      "binaryFile": "build/test.wasm",
      "use": "abort=assembly/builtin/abort"
    }
  },
  "options": {}
}

crash report like this:
▌ Whoops, the AssemblyScript compiler has crashed during initialize :-(

▌ Here is the stack trace hinting at the problem, perhaps it's useful?

▌ Error: no such global element: assembly/builtin/abort
▌ at Program.initialize (/home/ccc/Desktop/opensource/assemblyscript/src/program.ts:1415:19)
▌ at Object.initializeProgram (/home/ccc/Desktop/opensource/assemblyscript/src/index.ts:274:11)
▌ at /home/ccc/Desktop/opensource/assemblyscript/cli/asc.js:886:22
▌ at measure (/home/ccc/Desktop/opensource/assemblyscript/cli/asc.js:1409:3)
▌ at Object.main (/home/ccc/Desktop/opensource/assemblyscript/cli/asc.js:884:27)
▌ at /home/ccc/Desktop/opensource/assemblyscript/bin/asc:19:47

▌ If it refers to the dist files, try to 'npm install source-map-support' and
▌ run again, which should then show the actual code location in the sources.

▌ If you see where the error is, feel free to send us a pull request. If not,
▌ please let us know: https://github.com/AssemblyScript/assemblyscript/issues

▌ Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions