Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: src/wasm/module-decoder.cc

Issue 2904193003: [WASM] Use better error message when decoding function body fails. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/module-decoder.cc
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc
index ecf4a160da234b8e856d654b2377b195992119c3..bfadb902789fc714611a0737909f57a6a781d28f 100644
--- a/src/wasm/module-decoder.cc
+++ b/src/wasm/module-decoder.cc
@@ -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());
Mircea Trofin 2017/05/31 14:51:42 Does str() flush?
bbudge 2017/06/01 00:53:26 I think flush is a nop on string streams, since da
// Set error code and location, if this is the first error.
if (intermediate_result_.ok()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698