Commit Graph

7 Commits

Author SHA1 Message Date
Dan Gohman
8dbd4b8d7c Start a wast testing harness and add some tests.
This implements a minimal wast testing harness in tests/wast.rs, which
runs the wast tests under tests/wast.

It also adds tests for trapping in a variety of ways, and fixes several
bugs exposed by those tests.
2018-12-05 02:25:34 -05:00
Dan Gohman
a6b54330c0 Switch Darwin to use PC-redirection for calling the Unwind function. 2018-12-05 02:25:34 -05:00
Dan Gohman
5ae48b06e1 Fix the pthread_detach assert on Darwin. 2018-11-29 06:22:39 -08:00
Dan Gohman
38acc069fa Fix compilation errors on Darwin. 2018-11-29 06:01:25 -08:00
Dan Gohman
adb76ba9f1 Avoid casting to/from greg_t, which doesn't work consistently across platforms. 2018-11-29 05:59:17 -08:00
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