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

Legacy WASM backend produces a broken binary: "i64.reinterpret_f64[0] expected type f64, found local.get of type i32" #965

Open
lax1dude opened this issue Oct 28, 2024 · 0 comments

Comments

@lax1dude
Copy link
Contributor

TeaVM Version: 0.10.2

I've found how to reproduce one of the problems I found later on in our discussion over #955. TeaVM is able to compile it without crashing, the error happens when I attempt to load the compiled WASM binary in Chrome by typing WebAssembly.compileStreaming(fetch("classes.wasm")); into the devtools console.

Here is the code you can compile to reproduce it:

public class TestClass {

	public static void main(String[] args) {
		Double d = Double.valueOf(0.0);
		if(d.isNaN() || d.isInfinite()) {
			System.out.println("test");
		}
	}

}

It produces a WASM binary that creates the following error when I attempt to load it in Chrome:

Uncaught (in promise) CompileError: WebAssembly.compileStreaming(): Compiling function #9:"meth_TestClass_main" failed: i64.reinterpret_f64[0] expected type f64, found local.get of type i32 @+2095

Binary: https://ftp.deev.is/test/classes.wasm
Disassembly: https://ftp.deev.is/test/classes.wasm.out

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

1 participant