Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/12968

Change subject: systemc: Check the process type when using sc_join.
......................................................................

systemc: Check the process type when using sc_join.

Method processes aren't allowed in an sc_join.

Change-Id: I5c8421a396dbe261645a074df514f69fc652c9c8
---
M src/systemc/core/sc_join.cc
A src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode
2 files changed, 8 insertions(+), 0 deletions(-)



diff --git a/src/systemc/core/sc_join.cc b/src/systemc/core/sc_join.cc
index 3e4c6ee..3c27eaa 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 @@
     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 0000000..d00491f
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode
@@ -0,0 +1 @@
+1

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12968
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I5c8421a396dbe261645a074df514f69fc652c9c8
Gerrit-Change-Number: 12968
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to