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

Add EVMC_TRAP_INSTRUCTION error code #56

Merged
merged 2 commits into from
Aug 20, 2018
Merged

Add EVMC_TRAP_INSTRUCTION error code #56

merged 2 commits into from
Aug 20, 2018

Conversation

axic
Copy link
Member

@axic axic commented Aug 10, 2018

No description provided.

@axic axic requested a review from chfast August 10, 2018 11:36
* This is useful for WebAssembly implementations, where the `unreachable`
* instruction and various execution errors are turned into a trap.
*/
EVMC_TRAP_INSTRUCTION = 14,
Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

@chfast
Copy link
Member

chfast commented Aug 13, 2018

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 EVMC_FAILURE.

@axic
Copy link
Member Author

axic commented Aug 18, 2018

@chfast updated.

@chfast chfast merged commit e319788 into master Aug 20, 2018
@chfast chfast deleted the trap-error branch August 20, 2018 09:20
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

Successfully merging this pull request may close these issues.

2 participants