Skip to content

compiler crash with unreachable in BlockStatement #2187

Closed
@HerrCai0907

Description

@HerrCai0907

code:

export function test(a: i32): i32 {
  let t = [];
  if (t.length == 0) {
    return 2;
  }
  {
    return unreachable();
  }
}

Error Message:

[wasm-validator error in function assembly/index/test] unexpected false: local.get must have a valid type - check what you provided when you constructed the node, on 
(local.get $4)
[wasm-validator error in function assembly/index/test] unexpected false: vars must be defaultable, on 
unreachable
FAILURE validate error
    at Object.main (/home/ccc/Desktop/test/as/node_modules/assemblyscript/cli/asc.js:953:23)
    at /home/ccc/Desktop/test/as/node_modules/assemblyscript/bin/asc:19:47

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