diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-11 20:49:51 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-11 20:49:51 -0800 |
commit | e53badb26a1a3d2de0c7df30bb7e656299d91b21 (patch) | |
tree | e8a349ca330abdb939b8c78e2f1a932f34ea27ee /test/example/find_div0s.cpp | |
parent | d66ced45eeab6f890972a4789789164f026cb259 (diff) | |
download | binaryen-e53badb26a1a3d2de0c7df30bb7e656299d91b21.tar.gz binaryen-e53badb26a1a3d2de0c7df30bb7e656299d91b21.tar.bz2 binaryen-e53badb26a1a3d2de0c7df30bb7e656299d91b21.zip |
text
Diffstat (limited to 'test/example/find_div0s.cpp')
-rw-r--r-- | test/example/find_div0s.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/example/find_div0s.cpp b/test/example/find_div0s.cpp index 77a5d2c61..be273390f 100644 --- a/test/example/find_div0s.cpp +++ b/test/example/find_div0s.cpp @@ -1,11 +1,18 @@ +// +// Tiny example, using Binaryen to walk a WebAssembly module in search +// for direct integer divisions by zero. To do so, we inherit from +// WasmWalker, and implement visitBinary, which is called on every +// Binary node in the module's functions. +// + #include <ostream> #include <wasm.h> using namespace wasm; int main() { - // A module with a function with a division by zero in the body + // A module with a function with a division by zero in the body. Module module; Function func; func.name = "func"; |