diff options
author | Alon Zakai <azakai@google.com> | 2022-10-17 13:47:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 20:47:40 +0000 |
commit | a60a7167e202003ec1fbea5405ee53e80fd85e21 (patch) | |
tree | e36b38c40af5a00e4260ddf07e1d2728c9f3219a /src | |
parent | 3e44a9fc542572592ee1ee1bdec19bf1904faaa3 (diff) | |
download | binaryen-a60a7167e202003ec1fbea5405ee53e80fd85e21.tar.gz binaryen-a60a7167e202003ec1fbea5405ee53e80fd85e21.tar.bz2 binaryen-a60a7167e202003ec1fbea5405ee53e80fd85e21.zip |
Binary format: Don't emit empty Memory sections (#5145)
If the only memories are imported, we don't need the section. We were already
doing that for tables, functions, etc.
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm/wasm-binary.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index 364942a56..5d21f5130 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -204,7 +204,7 @@ void WasmBinaryWriter::writeStart() { } void WasmBinaryWriter::writeMemories() { - if (wasm->memories.empty()) { + if (importInfo->getNumDefinedMemories() == 0) { return; } BYN_TRACE("== writeMemories\n"); |