model/action: bugfix - UNINIT actions do not have a Node
[model-checker.git] / model.cc
index 1499d12aa3a9a6c8c24c9838602c23f532c86140..7bff598f974e762daecc27d7d58926bdfa466d68 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -2510,7 +2510,10 @@ void ModelChecker::build_reads_from_past(ModelAction *curr)
 }
 
 bool ModelChecker::sleep_can_read_from(ModelAction * curr, const ModelAction *write) {
-       while(true) {
+       while (true) {
+               /* UNINIT actions don't have a Node, and they never sleep */
+               if (write->is_uninitialized())
+                       return true;
                Node *prevnode=write->get_node()->get_parent();
 
                bool thread_sleep=prevnode->enabled_status(curr->get_tid())==THREAD_SLEEP_SET;