Skip to content

invoke outputs garbage #122

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

Closed
kg opened this issue Oct 9, 2015 · 1 comment
Closed

invoke outputs garbage #122

kg opened this issue Oct 9, 2015 · 1 comment

Comments

@kg
Copy link
Contributor

kg commented Oct 9, 2015

When invoking functions with a void return type, ml-proto acts like they have a return type and outputs garbage (the last expression in the function body, seems like?)

(module 
  (import $write "stdio" "write" (param i32 i32))

  (memory 4096 4096 (segment 0 "\89\50\4e\47\0d\0a\1a\0a\00"))

  (func $write_png_header
    (call_import $write (i32.const 0) (i32.const 9))
    (i32.const 7)
  )

  (export "write_png_header" $write_png_header)
)

(invoke "write_png_header")

prints 7 : i32 at the end.

@lukewagner
Copy link
Member

It's not "garbage", it's just not replacing the result of evaluating the body with None, as it ought.

Connicpu pushed a commit to Connicpu/wasm-spec that referenced this issue May 11, 2020
ngzhian pushed a commit to ngzhian/spec that referenced this issue Nov 4, 2021
Introduce Pseudo-Minimum (`f32x4.pmin` and `f64x2.pmin`) and Pseudo-Maximum (`f32x4.pmax` and `f64x2.pmax`) instructions, which implement Pseudo-Minimum and Pseudo-Maximum operations with slightly different semantics than the Minimum and Maximum in the current spec. Pseudo-Minimum is defined as `pmin(a, b) := b < a ? b : a` and Pseudo-Maximum is defined as `pmax(a, b) := a < b ? b : a`. "Pseudo" in the name refers to the fact that these operations may not return the minimum in case of signed zero inputs, in particular:
- `pmin(+0.0, -0.0) == +0.0`
- `pmax(-0.0, +0.0) == -0.0`
rossberg pushed a commit that referenced this issue Sep 4, 2024
Check multiple calls to relaxed instructions return same results
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