-
Notifications
You must be signed in to change notification settings - Fork 12
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
eei return: Trap condition: unreachable #1
Comments
revert
: Trap condition: unreachable
Maybe you already know this, but the Wasm spec requires host functions to return with the type in their signature (or never return if they are in an infinite loop). So perhaps you can return in a way which triggers a Wasm trap, which allows Wasm to handle the trap and exit cleanly. This can be optimized later. |
Since it is not merged, we probably should remove those atm. |
Here's a generated code example (from sha256 precompile):
While this would be unnecessary since the function would never return anyway, it is a nice behaviour to ensure a non-compliant VM fails 😉 I'd really prefer to merge ewasm/design#72 and keep 😕 |
Since the design issue was decided on and ewasm/hera#249 was merged, this can be closed. |
Getting error:
Trap condition: unreachable
To compare, I imported the return function manually and tried to return the same data, while calling the manually imported function the test pass without errors, I realized the only difference between the manually imported function and the ewasm-rust-api function is that ewasm-api function specifies that the function never returns (using return type
-> !
).ewasm-rust-api/src/lib.rs
Line 8 in 30112f5
The text was updated successfully, but these errors were encountered: