model: add 'pending' assertion
authorBrian Norris <banorris@uci.edu>
Wed, 13 Feb 2013 02:12:17 +0000 (18:12 -0800)
committerBrian Norris <banorris@uci.edu>
Fri, 15 Feb 2013 22:55:02 +0000 (14:55 -0800)
We don't want to clobber a pending action.

model.cc

index 97f235c463ce2915fb136865e3bd7a3fc0aaebbb..01e4c491a9e637cb1c1ffd2b78607c82f2472e82 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -2663,6 +2663,7 @@ uint64_t ModelChecker::switch_to_master(ModelAction *act)
 {
        DBG();
        Thread *old = thread_current();
+       ASSERT(!old->get_pending());
        old->set_pending(act);
        if (Thread::swap(old, &system_context) < 0) {
                perror("swap threads");