From f1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Mon, 15 May 2017 10:07:21 -0700 Subject: 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. --- src/binary-error-handler.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/binary-error-handler.cc') 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; } -- cgit v1.2.3