From: Brian Norris Date: Fri, 1 Mar 2013 07:51:55 +0000 (-0800) Subject: action, model: add ASSERT(), not NULL checks X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=6bbd9b9dd928e62df9dffbf9027124112eec0576 action, model: add ASSERT(), not NULL checks These should never be called with NULL. Don't make them a real conditional. --- diff --git a/action.cc b/action.cc index 81f447a5..0a6a1dd2 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 9ebc8534..b10a841a 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();