diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-04-15 11:15:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-15 11:15:17 -0700 |
commit | a803c119f1a4babb7efc3dda0f475e1e87893475 (patch) | |
tree | c9e23c81b8898b5bc9fada2c4c4a7b87c835bc86 /src/wasm-binary.h | |
parent | 9495b338121140d585648d64fb99e8ef7f92f867 (diff) | |
download | binaryen-a803c119f1a4babb7efc3dda0f475e1e87893475.tar.gz binaryen-a803c119f1a4babb7efc3dda0f475e1e87893475.tar.bz2 binaryen-a803c119f1a4babb7efc3dda0f475e1e87893475.zip |
DataCount section (#2006)
* DataCount section
Read the DataCount section and verify that it agrees with the data
section. Also emit the DataCount section when bulk-memory is enabled
and there are a nonzero number of segments. Factor out some shared
unit test code.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r-- | src/wasm-binary.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 50b78fbae..1f6222cba 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -322,7 +322,8 @@ enum Section { Start = 8, Element = 9, Code = 10, - Data = 11 + Data = 11, + DataCount = 12, }; enum SegmentFlag { @@ -891,6 +892,7 @@ public: void writeFunctions(); void writeGlobals(); void writeExports(); + void writeDataCount(); void writeDataSegments(); std::unordered_map<Name, Index> mappedFunctions; // name of the Function => index. first imports, then internals @@ -1083,8 +1085,14 @@ public: std::map<Index, Name> mappedGlobals; // index of the Global => name. first imported globals, then internal globals Name getGlobalName(Index index); + void validateBinary(); // validations that cannot be performed on the Module void processFunctions(); + + size_t dataCount = 0; + bool hasDataCount = false; + void readDataSegments(); + void readDataCount(); std::map<Index, std::vector<Index>> functionTable; |