summaryrefslogtreecommitdiff
path: root/src/binary-reader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/binary-reader.cc')
-rw-r--r--src/binary-reader.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/binary-reader.cc b/src/binary-reader.cc
index a0b31787..33801a7d 100644
--- a/src/binary-reader.cc
+++ b/src/binary-reader.cc
@@ -3044,7 +3044,8 @@ Result BinaryReader::ReadModule(const ReadModuleOptions& options) {
"function signature count != function body count");
// This is checked in ReadDataSection, but it must be checked at the end too,
// in case the data section was omitted.
- ERROR_IF(num_data_segments_ == 0 && data_count_ != kInvalidIndex,
+ ERROR_IF(num_data_segments_ == 0 && data_count_ != kInvalidIndex &&
+ data_count_ != 0,
"Data section missing but DataCount non-zero");
CALLBACK0(EndModule);