Skip to content

Parser reports constant out of range at incorrect source location #69

@sunfishcode

Description

@sunfishcode

For this testcase:

(module
  (func $add (param $x i32) (param $y i32) (result i32)
    (i32.add (get_local $x) (get_local $y))
  )
  (export "add" $add)
)

(assert_eq
  (invoke "add" (i32.reinterpret/f32 (f32.const 1.0)) (i32.const 0.0))
  (i32.const 1065353216)
)

wasm says:

test/test.wasm:8.2-8.11: constant out of range

The actual error is that I had copypastad a 0.0 into an i32 constant, but it took me a while to figure that out because the source line of the error message points at the assert_eq.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions