diff options
author | Ben Smith <binjimin@gmail.com> | 2018-05-07 13:56:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-07 13:56:13 -0700 |
commit | 9890d45ff4e04a89ba53137d5f569c5038df8d27 (patch) | |
tree | 35719be2d0f1ec6e5970140f5397f2875b1e2749 /src/binary-reader-objdump.cc | |
parent | 4228d2f1396c98b54c9c342505304eeb36447ac6 (diff) | |
download | wabt-9890d45ff4e04a89ba53137d5f569c5038df8d27.tar.gz wabt-9890d45ff4e04a89ba53137d5f569c5038df8d27.tar.bz2 wabt-9890d45ff4e04a89ba53137d5f569c5038df8d27.zip |
Add flag to ignore errors in custom sections (#833)
If a wasm engine fails to parse a custom section, it must not be an
error. In wabt we often won't want to continue if a custom section can't
be parsed, but it still may be useful to be able to continue.
This change adds a new flag `--ignore-custom-section-errors` to
`wasm2wat` and `wasm-validate`, which will partially parse a custom
section with errors. This could lead to some strange behavior (partially
completed data structures), but generally should be safe to do.
See issue #378 and the discussion on pull #830 for more info.
Diffstat (limited to 'src/binary-reader-objdump.cc')
-rw-r--r-- | src/binary-reader-objdump.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index 6e3982e9..083ee29d 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -1425,8 +1425,9 @@ Result ReadBinaryObjdump(const uint8_t* data, features.EnableAll(); const bool kReadDebugNames = true; const bool kStopOnFirstError = false; + const bool kFailOnCustomSectionError = false; ReadBinaryOptions read_options(features, options->log_stream, kReadDebugNames, - kStopOnFirstError); + kStopOnFirstError, kFailOnCustomSectionError); switch (options->mode) { case ObjdumpMode::Prepass: { |