From 781e08e3ef857eb738fe54e6ef426717f99f5364 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Tue, 29 Aug 2017 23:24:48 -0700 Subject: 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` --- src/binary-reader-interpreter.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/binary-reader-interpreter.cc') 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; } -- cgit v1.2.3