Commit 91152884 authored by bbudge's avatar bbudge Committed by Commit Bot

[WASM] Use better error message when decoding function body fails.

BUG=v8:6325

Review-Url: https://codereview.chromium.org/2904193003
Cr-Commit-Position: refs/heads/master@{#45714}
parent 7fa77063
......@@ -960,8 +960,9 @@ class ModuleDecoder : public Decoder {
allocator, menv == nullptr ? nullptr : menv->module_env.module, body);
if (result.failed()) {
// Wrap the error message from the function decoder.
std::ostringstream str;
str << "in function " << func_name << ": " << result.error_msg();
std::ostringstream wrapped;
wrapped << "in function " << func_name << ": " << result.error_msg();
result.error(result.error_offset(), wrapped.str());
// Set error code and location, if this is the first error.
if (intermediate_result_.ok()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment