-
Notifications
You must be signed in to change notification settings - Fork 310
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
Add EVMC_TRAP_INSTRUCTION error code #56
Conversation
include/evmc/evmc.h
Outdated
* This is useful for WebAssembly implementations, where the `unreachable` | ||
* instruction and various execution errors are turned into a trap. | ||
*/ | ||
EVMC_TRAP_INSTRUCTION = 14, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be merged with EVMC_INVALID_INSTRUCTION
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather not, because trap can be caused not only by a contract design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decision: use EVMC_UNREACHABLE_INSTRUCTION
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition we could have EVMC_WEBASSEMBLY_TRAP
for the generic trap case as specified by the wasm spec.
I'm not sure this is so great idea, because it only reference to the way the exception was implemented in Ewasm. If you cannot distinguish division by zero (wasm builtin trap condition) from ones caused by contract code explicitly, you might want to use generic |
@chfast updated. |
No description provided.