diff options
author | Ben Smith <binjimin@gmail.com> | 2017-03-13 16:32:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-13 16:32:11 -0700 |
commit | a02beb8e12b21f63dcfbf862366d3e44f4eb62d3 (patch) | |
tree | 64833025e93a154d7166dfbcddf04fcfea85ce03 /src/binary-reader-objdump.cc | |
parent | a17662511d4e7c277f5add3b61453e7b708b2756 (diff) | |
download | wabt-a02beb8e12b21f63dcfbf862366d3e44f4eb62d3.tar.gz wabt-a02beb8e12b21f63dcfbf862366d3e44f4eb62d3.tar.bz2 wabt-a02beb8e12b21f63dcfbf862366d3e44f4eb62d3.zip |
Fix crash using binary reader logging with error (#351)
When the binary logging is turned on, it can't use the
`reader->on_error` directly since that function expects that the
user_data is the BinaryReaderInterpreter context (for example), but it
is actually the LoggingContext.
To make it easier for users to use the default error handler, now they
return a bool saying whether the error was handled.
Some additional changes:
* Add a test that uses logging and succeeds
* Add a test that uses logging and has an error
* Change the `run-*-interp.py` scripts to use `-t` for tracing and `-v`
for logging
Diffstat (limited to 'src/binary-reader-objdump.cc')
-rw-r--r-- | src/binary-reader-objdump.cc | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index fde0bbe0..64f909bf 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -637,14 +637,6 @@ Result on_reloc(RelocType type, return Result::Ok; } -static void on_error(BinaryReaderContext* ctx, const char* message) { - DefaultErrorHandlerInfo info; - info.header = "error reading binary"; - info.out_file = stdout; - info.print_header = PrintErrorHeader::Once; - default_binary_error_callback(ctx->offset, message, &info); -} - static Result begin_data_segment(uint32_t index, uint32_t memory_index, void* user_data) { @@ -687,7 +679,6 @@ Result read_binary_objdump(const uint8_t* data, } else { reader.begin_module = begin_module; reader.end_module = end_module; - reader.on_error = on_error; reader.begin_section = begin_section; |