diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-07-03 15:56:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-03 15:56:04 -0700 |
commit | 2a138faec4b21ee2eae89f00d1e00987bab6305a (patch) | |
tree | 9a6482a76a5e796fa27fd95e9a299c7b37bf17a3 /src/wasm/wasm-validator.cpp | |
parent | 256187c823ab6a04b3b55c3d9d3497ae2004d165 (diff) | |
download | binaryen-2a138faec4b21ee2eae89f00d1e00987bab6305a.tar.gz binaryen-2a138faec4b21ee2eae89f00d1e00987bab6305a.tar.bz2 binaryen-2a138faec4b21ee2eae89f00d1e00987bab6305a.zip |
Initial tail call implementation (#2197)
Including parsing, printing, assembling, disassembling.
TODO:
- interpreting
- effects
- finalization and typing
- fuzzing
- JS/C API
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r-- | src/wasm/wasm-validator.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 1d12c2452..01cb1e2a8 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -569,6 +569,9 @@ void FunctionValidator::visitSwitch(Switch* curr) { } void FunctionValidator::visitCall(Call* curr) { + shouldBeTrue(!curr->isReturn || getModule()->features.hasTailCall(), + curr, + "return_call requires tail calls to be enabled"); if (!info.validateGlobally) { return; } @@ -593,6 +596,9 @@ void FunctionValidator::visitCall(Call* curr) { } void FunctionValidator::visitCallIndirect(CallIndirect* curr) { + shouldBeTrue(!curr->isReturn || getModule()->features.hasTailCall(), + curr, + "return_call_indirect requires tail calls to be enabled"); if (!info.validateGlobally) { return; } |