diff options
author | Gabe Black <gabeblack@google.com> | 2018-09-27 01:16:42 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-16 00:38:23 +0000 |
commit | 5bdeb1a432430dcb265cef77fa9365eceddce7d7 (patch) | |
tree | 83cd6f4e0601dd52e2d226e1b8fe61e8696c2f0f /src/systemc/core/sc_main.cc | |
parent | 07cad60bb0865d95cfe4c5ce2ea08d7c8d33f34f (diff) | |
download | gem5-5bdeb1a432430dcb265cef77fa9365eceddce7d7.tar.xz |
systemc: Modify reportifyException to keep sc_reports in scope.
reportifyException was sometimes indirectly creating temporary
sc_report objects which would go out of scope when they were
returned. The later code which tried to print them would then read
garbage.
Change-Id: I0a744eb029c62bf2ffee83db0a0e6dcbe3e60f7d
Reviewed-on: https://gem5-review.googlesource.com/c/13190
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/sc_main.cc')
-rw-r--r-- | src/systemc/core/sc_main.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/systemc/core/sc_main.cc b/src/systemc/core/sc_main.cc index e9df6a1e0..59ec9f8bd 100644 --- a/src/systemc/core/sc_main.cc +++ b/src/systemc/core/sc_main.cc @@ -81,8 +81,7 @@ class ScMainFiber : public Fiber resultStr = r.what(); } catch (...) { // There was some other type of exception we need to wrap. - const sc_report *r = ::sc_gem5::reportifyException(); - resultStr = r->what(); + resultStr = ::sc_gem5::reportifyException().what(); } ::sc_gem5::Kernel::scMainFinished(true); ::sc_gem5::scheduler.clear(); |