summaryrefslogtreecommitdiff
path: root/src/binary-reader-interpreter.cc
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2017-08-29 23:24:48 -0700
committerGitHub <noreply@github.com>2017-08-29 23:24:48 -0700
commit781e08e3ef857eb738fe54e6ef426717f99f5364 (patch)
treefc613a3e53d576bcb420d94dbaeefcae1051dd4d /src/binary-reader-interpreter.cc
parent7d33b3f26fc5aead990a35e4d089eaf2d5053202 (diff)
downloadwabt-781e08e3ef857eb738fe54e6ef426717f99f5364.tar.gz
wabt-781e08e3ef857eb738fe54e6ef426717f99f5364.tar.bz2
wabt-781e08e3ef857eb738fe54e6ef426717f99f5364.zip
Move Result to its own file (result.h) (#600)
* Unify all uses of `CHECK_RESULT` * Use `CHECK_RESULT` in a few more places * Add `operator|` and `operator|=` to `Result`, use it instead of `COMBINE_RESULT` * Change a few occurrences of `!Succeeded` to `Failed`
Diffstat (limited to 'src/binary-reader-interpreter.cc')
-rw-r--r--src/binary-reader-interpreter.cc13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/binary-reader-interpreter.cc b/src/binary-reader-interpreter.cc
index 7cb3e676..ee51c07d 100644
--- a/src/binary-reader-interpreter.cc
+++ b/src/binary-reader-interpreter.cc
@@ -29,12 +29,6 @@
#include "type-checker.h"
#include "writer.h"
-#define CHECK_RESULT(expr) \
- do { \
- if (Failed(expr)) \
- return wabt::Result::Error; \
- } while (0)
-
namespace wabt {
using namespace interpreter;
@@ -473,11 +467,8 @@ wabt::Result BinaryReaderInterpreter::GetBrDropKeepCount(
wabt::Result BinaryReaderInterpreter::GetReturnDropKeepCount(
Index* out_drop_count,
Index* out_keep_count) {
- if (Failed(GetBrDropKeepCount(label_stack.size() - 1, out_drop_count,
- out_keep_count))) {
- return wabt::Result::Error;
- }
-
+ CHECK_RESULT(GetBrDropKeepCount(label_stack.size() - 1, out_drop_count,
+ out_keep_count));
*out_drop_count += current_func->param_and_local_types.size();
return wabt::Result::Ok;
}