diff options
author | Ben Smith <binjimin@gmail.com> | 2018-05-16 19:21:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-16 19:21:19 -0700 |
commit | 1fec702978b82945f5e6097f765d505f25f30097 (patch) | |
tree | c1df59bd7fdfc8609c1eac150e3dd5a85854c1c7 /src/wast-parser.cc | |
parent | dd7663d78bf483308cd8d70d114748321f2cd61f (diff) | |
download | wabt-1fec702978b82945f5e6097f765d505f25f30097.tar.gz wabt-1fec702978b82945f5e6097f765d505f25f30097.tar.bz2 wabt-1fec702978b82945f5e6097f765d505f25f30097.zip |
Print "warning" for ignored custom section errors (#843)
The previous message said "error", which makes it look like the output
is not created, so change the message to "warning" instead.
The error handling code is pretty ugly and can use a refactor, but that
would be a much larger change.
Diffstat (limited to 'src/wast-parser.cc')
-rw-r--r-- | src/wast-parser.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc index 3381b65e..ae793bf8 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -108,7 +108,8 @@ void RemoveEscapes(const TextVector& texts, OutputIter out) { class BinaryErrorHandlerModule : public ErrorHandler { public: BinaryErrorHandlerModule(Location* loc, WastParser* parser); - bool OnError(const Location&, + bool OnError(ErrorLevel, + const Location&, const std::string& error, const std::string& source_line, size_t source_line_column_offset) override; @@ -125,10 +126,12 @@ BinaryErrorHandlerModule::BinaryErrorHandlerModule(Location* loc, WastParser* parser) : ErrorHandler(Location::Type::Binary), loc_(loc), parser_(parser) {} -bool BinaryErrorHandlerModule::OnError(const Location& binary_loc, +bool BinaryErrorHandlerModule::OnError(ErrorLevel error_level, + const Location& binary_loc, const std::string& error, const std::string& source_line, size_t source_line_column_offset) { + assert(error_level == ErrorLevel::Error); if (binary_loc.offset == kInvalidOffset) { parser_->Error(*loc_, "error in binary module: %s", error.c_str()); } else { |