Commit Graph

2 Commits

Author SHA1 Message Date
Dan Gohman
2a760ae5e8 Add tests that trap, and fix handling of SIGFPE on x86. 2018-11-27 06:38:28 -08:00
Dan Gohman
35627cf37f Implement wasm trap handlers. (#27)
* Implement wasm trap handlers.

This adds signal handlers based on SpiderMonkey's signal-handler code.
The functionality for looking up the trap code and wasm bytecode offset
isn't yet implemented, but this is a start.

I considered rewriting this code in Rust, but decided against it for now
as C++ allows us to talk to the relevant OS APIs more directly.

Fixes #15.

* Compile with -std=c++11.

* Refactor InstallState initialization.

* Compile with -fPIC.

* Factor out the code for calling a wasm function with a given index.

* Fix unclear wording in a comment.
2018-11-27 06:05:58 -08:00