-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from WebAssembly/runaway-recursion
Handle interpreter stack overflow, and test runaway recursion.
- Loading branch information
Showing
4 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(module | ||
;; Implementations are required to have every call consume some abstract | ||
;; resource towards exhausting some abstract finite limit, such that | ||
;; infinitely recursive testcases reliably trap in finite time. This is | ||
;; because otherwise applications could come to depend on it on those | ||
;; implementations and be incompatible with implementations that don't do | ||
;; it (or don't do it under the same circumstances). | ||
(func (call 0)) | ||
(export "runaway" 0) | ||
|
||
(func $a (call $b)) | ||
(func $b (call $a)) | ||
(export "mutual_runaway" $a) | ||
) | ||
|
||
(assert_trap (invoke "runaway") "runtime: callstack exhausted") | ||
(assert_trap (invoke "mutual_runaway") "runtime: callstack exhausted") |