summaryrefslogtreecommitdiff
path: root/src/binary-writer.cc
diff options
context:
space:
mode:
authorRian Hunter <rianhunter@users.noreply.github.com>2020-03-23 11:34:43 -0700
committerGitHub <noreply@github.com>2020-03-23 11:34:43 -0700
commit0a4d0eebb73c2a8f5e5b8ff004f840d832db723a (patch)
tree900c288b2f3fcfe309ddcbb4b9333b91930de03c /src/binary-writer.cc
parent5ba0296190a077acfdc6c1de19510143b4dcc7c4 (diff)
downloadwabt-0a4d0eebb73c2a8f5e5b8ff004f840d832db723a.tar.gz
wabt-0a4d0eebb73c2a8f5e5b8ff004f840d832db723a.tar.bz2
wabt-0a4d0eebb73c2a8f5e5b8ff004f840d832db723a.zip
Always generate DataCount section, even if number of datas is 0 (#1369)
* Always generate DataCount section, even if number of datas is 0 The bulk-memory spec requires that a DataCount section is always present if a memory.init or data.drop instruction is present in the following code section. This requirement remains even if the number of datas is 0, so remove that condition. Fixes #1368 * Fix tests
Diffstat (limited to 'src/binary-writer.cc')
-rw-r--r--src/binary-writer.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/binary-writer.cc b/src/binary-writer.cc
index d9db81df..bd285599 100644
--- a/src/binary-writer.cc
+++ b/src/binary-writer.cc
@@ -1133,8 +1133,7 @@ Result BinaryWriter::WriteModule() {
EndSection();
}
- if (options_.features.bulk_memory_enabled() &&
- module_->data_segments.size()) {
+ if (options_.features.bulk_memory_enabled()) {
// Keep track of the data count section offset so it can be removed if
// it isn't needed.
data_count_start_ = stream_->offset();