summaryrefslogtreecommitdiff
path: root/src/binary-error-handler.cc
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2017-05-15 10:07:21 -0700
committerGitHub <noreply@github.com>2017-05-15 10:07:21 -0700
commitf1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0 (patch)
tree1c2144a7c8acadf0850ad183920d0b247ddc501c /src/binary-error-handler.cc
parent5d10e89b5d796edc62cfb6bc3f806d8a1b1272c0 (diff)
downloadwabt-f1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0.tar.gz
wabt-f1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0.tar.bz2
wabt-f1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0.zip
Use Index/Address/Offset instead of uint32_t (#433)
An `Index` is an index into one of the WebAssembly index spaces. It also is used for counts for these spaces, as well as parameter counts and result counts. An `Address` is an index into linear memory, or the size of a data region in linear memory. An `Offset` is an offset into the host's file or memory buffer. This fixes issue #322.
Diffstat (limited to 'src/binary-error-handler.cc')
-rw-r--r--src/binary-error-handler.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/binary-error-handler.cc b/src/binary-error-handler.cc
index c785d2af..5f354e94 100644
--- a/src/binary-error-handler.cc
+++ b/src/binary-error-handler.cc
@@ -25,13 +25,12 @@ BinaryErrorHandlerFile::BinaryErrorHandlerFile(FILE* file,
PrintHeader print_header)
: file_(file), header_(header), print_header_(print_header) {}
-bool BinaryErrorHandlerFile::OnError(uint32_t offset,
- const std::string& error) {
+bool BinaryErrorHandlerFile::OnError(Offset offset, const std::string& error) {
PrintErrorHeader();
- if (offset == WABT_UNKNOWN_OFFSET)
+ if (offset == kInvalidOffset)
fprintf(file_, "error: %s\n", error.c_str());
else
- fprintf(file_, "error: @0x%08x: %s\n", offset, error.c_str());
+ fprintf(file_, "error: @0x%08" PRIzx ": %s\n", offset, error.c_str());
fflush(file_);
return true;
}