summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-04-18 15:40:30 -0700
committerGitHub <noreply@github.com>2019-04-18 15:40:30 -0700
commit5becae69e29c876f3ba46d6746764e409bd7fd9b (patch)
treef0fee2c10772faf9466b3f5ec0828e98184e516c /src/wasm
parent9233afca9a27f8794fb0c8b79b5fa0d8e47060d4 (diff)
downloadbinaryen-5becae69e29c876f3ba46d6746764e409bd7fd9b.tar.gz
binaryen-5becae69e29c876f3ba46d6746764e409bd7fd9b.tar.bz2
binaryen-5becae69e29c876f3ba46d6746764e409bd7fd9b.zip
Reland emitting of DataCount section (#2027)
This reverts commit cb2d63586c08a3dd194d2b733ceb3f5051c081f8. The issues with feature validation were mostly resolved in #1993, and this PR finishes the job by adding feature flags to wasm-as to avoid emitting the DataCount section when bulk-memory is not enabled.
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/wasm-binary.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index d6091e93c..f3642203d 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -317,14 +317,9 @@ void WasmBinaryWriter::writeDataCount() {
if (!wasm->features.hasBulkMemory() || !wasm->memory.segments.size()) {
return;
}
-
- // TODO(tlively): re-enable writing the data count once the default feature
- // set is no longer All, which causes validation errors in Emscripten due to
- // the presence of an unrecognized section.
-
- // auto start = startSection(BinaryConsts::Section::DataCount);
- // o << U32LEB(wasm->memory.segments.size());
- // finishSection(start);
+ auto start = startSection(BinaryConsts::Section::DataCount);
+ o << U32LEB(wasm->memory.segments.size());
+ finishSection(start);
}
void WasmBinaryWriter::writeDataSegments() {