Skip to content

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

Closed

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.

Activity

  1. lukewagner commented on Oct 29, 2015

    @lukewagner
    Member

    This appears to be fixed (and I think I recall fixing it).

  2. added a commit that references this issue on Feb 11, 2021
  3. added a commit that references this issue on Mar 2, 2023
  4. added a commit that references this issue on Oct 3, 2023
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