From 6bbd9b9dd928e62df9dffbf9027124112eec0576 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 28 Feb 2013 23:51:55 -0800 Subject: [PATCH] action, model: add ASSERT(), not NULL checks These should never be called with NULL. Don't make them a real conditional. --- action.cc | 3 ++- model.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/action.cc b/action.cc index 81f447a..0a6a1dd 100644 --- a/action.cc +++ b/action.cc @@ -392,9 +392,10 @@ Node * ModelAction::get_node() const */ void ModelAction::set_read_from(const ModelAction *act) { + ASSERT(act); reads_from = act; reads_from_promise = NULL; - if (act && act->is_uninitialized()) + if (act->is_uninitialized()) model->assert_bug("May read from uninitialized atomic\n"); } diff --git a/model.cc b/model.cc index 9ebc853..b10a841 100644 --- a/model.cc +++ b/model.cc @@ -1324,8 +1324,9 @@ bool ModelChecker::initialize_curr_action(ModelAction **curr) */ bool ModelChecker::read_from(ModelAction *act, const ModelAction *rf) { + ASSERT(rf); act->set_read_from(rf); - if (rf != NULL && act->is_acquire()) { + if (act->is_acquire()) { rel_heads_list_t release_heads; get_release_seq_heads(act, act, &release_heads); int num_heads = release_heads.size(); -- 2.34.1