You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
asm2wasm frem miscompilation leads to wasm validation error #1105
Looks like neither f32.rem nor f64.rem are WebAssembly instructions, which means binaryen will try to replace it with a f64-rem function that it provides itself. Seems like there's no f32-rem. This seems to be the code that does the replacement:
Interestingly, this is part of visitCallImport which seems to be the function that fixes calls to imports. So I feel like that should've been fixing the arguments, but it maybe didn't get called?!
Activity
CryZe commentedon Jul 20, 2017
Looks like neither f32.rem nor f64.rem are WebAssembly instructions, which means binaryen will try to replace it with a f64-rem function that it provides itself. Seems like there's no f32-rem. This seems to be the code that does the replacement:
binaryen/src/asm2wasm.h
Lines 1822 to 1838 in e865f2f
Seems like it just needs a check that promotes the f32 arguments to f64, which seems to be done with:
Interestingly, this is part of visitCallImport which seems to be the function that fixes calls to imports. So I feel like that should've been fixing the arguments, but it maybe didn't get called?!
https://github.com/WebAssembly/binaryen/blob/master/src/asm2wasm.h#L1350
fix f32 frem in asm2wasm #1105
kripken commentedon Jul 20, 2017
Yeah, that's it, thanks. I think this was missed since clang doesn't end up emitting it, but looks like rust can. Fix is in #1106.
fix f32 frem in asm2wasm #1105 (#1106)
kripken commentedon Jul 20, 2017
Fixed by that PR.