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()) { |