diff options
author | Gabe Black <gabeblack@google.com> | 2018-09-22 06:35:06 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-16 00:28:49 +0000 |
commit | 0c3d23437a9961b46cb6e7f4150834f2345ed9fc (patch) | |
tree | e2313a89ff6635e9c17610b8b30231521d68936f /src/systemc | |
parent | 2ede803d7c29065c1e42442b495f773c03c68270 (diff) | |
download | gem5-0c3d23437a9961b46cb6e7f4150834f2345ed9fc.tar.xz |
systemc: Check the process type when using sc_join.
Method processes aren't allowed in an sc_join.
Change-Id: I5c8421a396dbe261645a074df514f69fc652c9c8
Reviewed-on: https://gem5-review.googlesource.com/c/12968
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc')
-rw-r--r-- | src/systemc/core/sc_join.cc | 7 | ||||
-rw-r--r-- | src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/systemc/core/sc_join.cc b/src/systemc/core/sc_join.cc index 3e4c6eec4..3c27eaa42 100644 --- a/src/systemc/core/sc_join.cc +++ b/src/systemc/core/sc_join.cc @@ -32,6 +32,7 @@ #include "systemc/ext/core/sc_event.hh" #include "systemc/ext/core/sc_join.hh" #include "systemc/ext/core/sc_module.hh" +#include "systemc/ext/utils/sc_report_handler.hh" namespace sc_core { @@ -44,6 +45,12 @@ sc_join::add_process(sc_process_handle h) auto p = (::sc_gem5::Process *)h; assert(p); + if (p->procKind() == SC_METHOD_PROC_) { + SC_REPORT_ERROR("(E561) Attempt to register method process " + "with sc_join object", ""); + return; + } + remaining++; p->joinWait(this); } diff --git a/src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode b/src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode @@ -0,0 +1 @@ +1 |