Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sunfishcode opened this issue Sep 16, 2015 · 1 comment
Closed

Comments

@sunfishcode
Copy link
Member

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.

@lukewagner
Copy link
Member

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

eqrion pushed a commit to eqrion/wasm-spec that referenced this issue Jul 18, 2019
rossberg added a commit that referenced this issue Feb 11, 2021
Per the vote on #69, this PR removes subtyping from the proposal. List of changes:

* Syntax:
  - remove `nullref` type
  - rename `anyref` type to `externref`
  - extend `ref.null` and `ref.is_null` instructions with new immediate of the form `func` or `extern` (this will later have to generalise to a `constype` per the [typed references proposal](https://github.com/WebAssembly/function-references))
* Typing rules:
  - `ref.null`, `ref.is_null`: determine reference type based on new immediate
  - `select`, `call_indirect`, `table.copy`, `table.init`: drop subtyping
  - `br_table`: revert to rule requiring same label types
  - `elem` segment: drop subtyping
  - `global` import: drop subtyping (link time)
* Remove subtyping rules and bottom type.
* Revert typing algorithm (interpreter and spec appendix).
* JS API:
  - remove `"nullref"`
  - rename `"anyref"` to `"externref"`
* Scripts:
  - rename `ref` result to `ref.extern`
  - rename `ref.host` value to `ref.extern`
  - drop subtyping from invocation type check
* JS translation:
  - extend harness with separate eq functions for each ref type
* Adjust tests:
  - apply syntax changes
  - remove tests for subtyping
  - change tests exercising subtyping in other ways
dhil pushed a commit to dhil/webassembly-spec that referenced this issue Mar 2, 2023
dhil pushed a commit to dhil/webassembly-spec that referenced this issue Oct 3, 2023
dhil pushed a commit to dhil/webassembly-spec that referenced this issue Aug 30, 2024
When looking up a type on the context, expand it (using `~~`) into the
expected composite type instead of using equality (`=`). Also fix some
places where equality should have been used when looking up tags.
Add `func` to expanded function types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants