Index: src/wasm/decoder.h |
diff --git a/src/wasm/decoder.h b/src/wasm/decoder.h |
index b556f932badd25f22215950ed8784568e76731b3..fc8f110b733f93e3eb9693b92cf7eb598aa0f794 100644 |
--- a/src/wasm/decoder.h |
+++ b/src/wasm/decoder.h |
@@ -253,7 +253,7 @@ class Decoder { |
template <typename T> |
Result<T> toResult(T val) { |
Result<T> result; |
- if (error_pc_) { |
+ if (failed()) { |
TRACE("Result error: %s\n", error_msg_.get()); |
result.error_code = kError; |
result.start = start_; |
@@ -279,8 +279,8 @@ class Decoder { |
error_msg_.reset(); |
} |
- bool ok() const { return error_pc_ == nullptr; } |
- bool failed() const { return !!error_msg_; } |
+ bool ok() const { return error_msg_ == nullptr; } |
+ bool failed() const { return !ok(); } |
bool more() const { return pc_ < limit_; } |
const byte* start() { return start_; } |