Fix the one place where ModelChecker looks for a Node in an UNINIT
action.
This also adds an ASSERT() within ModelAction to prevent calling
get_node() on an UNINIT action. It is technically OK to call get_node()
in this case, but most callers don't check for NULL, so it's better to
just catch the ASSERT() for this unwanted special case.
/** @return The Node associated with this ModelAction */
Node * ModelAction::get_node() const
{
+ /* UNINIT actions do not have a Node */
+ ASSERT(!is_uninitialized());
return node;
}
}
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;