diff options
author | Alon Zakai <azakai@google.com> | 2023-02-23 15:43:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-23 15:43:03 -0800 |
commit | c657aa9fd4c5afb8b55c484ccf34362d2b504200 (patch) | |
tree | 62beb00001d142932865680d299d6d37b074c075 /src | |
parent | f2596c7300ad4933529471e30008bdc2eafbc538 (diff) | |
download | binaryen-c657aa9fd4c5afb8b55c484ccf34362d2b504200.tar.gz binaryen-c657aa9fd4c5afb8b55c484ccf34362d2b504200.tar.bz2 binaryen-c657aa9fd4c5afb8b55c484ccf34362d2b504200.zip |
Fix validation of DataDrop (#5517)
Fixes #5511
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm/wasm-validator.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 28526cb33..a56f26be3 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -116,8 +116,9 @@ struct ValidationInfo { return stream; } - // checking utilities + // Checking utilities. + // Returns whether the result was in fact true. template<typename T> bool shouldBeTrue(bool result, T curr, @@ -127,8 +128,10 @@ struct ValidationInfo { fail("unexpected false: " + std::string(text), curr, func); return false; } - return result; + return true; } + + // Returns whether the result was in fact false. template<typename T> bool shouldBeFalse(bool result, T curr, @@ -138,7 +141,7 @@ struct ValidationInfo { fail("unexpected true: " + std::string(text), curr, func); return false; } - return result; + return true; } template<typename T, typename S> |