diff options
author | Alon Zakai <alonzakai@gmail.com> | 2019-04-08 17:26:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-08 17:26:24 -0700 |
commit | b56c691ab87c2cd09255b2617213ec5d8e92a748 (patch) | |
tree | 29d8cd53c0481e200a643e68f9bf6d436726ef9b /src/wasm.h | |
parent | c9eeaefbd839cc5176957e479475625fc8b2bcf0 (diff) | |
download | binaryen-b56c691ab87c2cd09255b2617213ec5d8e92a748.tar.gz binaryen-b56c691ab87c2cd09255b2617213ec5d8e92a748.tar.bz2 binaryen-b56c691ab87c2cd09255b2617213ec5d8e92a748.zip |
Better memory fuzzing (#1987)
Hash the contents of all of memory and log that out in random places in the fuzzer, so we are more sensitive there and can catch memory bugs.
Fix UB that was uncovered by this in the binary writing code - if a segment is empty, we should not look at &vector[0], and instead use vector.data().
Add Builder::addExport convenience method.
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm.h b/src/wasm.h index 763a4e764..700938ef9 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -947,10 +947,10 @@ public: Global* getGlobalOrNull(Name name); FunctionType* addFunctionType(std::unique_ptr<FunctionType> curr); - void addExport(Export* curr); - void addFunction(Function* curr); - void addFunction(std::unique_ptr<Function> curr); - void addGlobal(Global* curr); + Export* addExport(Export* curr); + Function* addFunction(Function* curr); + Function* addFunction(std::unique_ptr<Function> curr); + Global* addGlobal(Global* curr); void addStart(const Name& s); |