From: Brian Norris Date: Mon, 12 Mar 2012 23:52:04 +0000 (-0700) Subject: schedule: exit if we run out of linked-list nodes X-Git-Tag: pldi2013~592 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=cbbc5fce741e4c09bccff60a8e24ad0b93c9451c;hp=2f6506f4535415ffefb5c4735e9414a00bf5c1a8;p=model-checker.git schedule: exit if we run out of linked-list nodes --- diff --git a/schedule.c b/schedule.c index c8f54e8..879ee14 100644 --- a/schedule.c +++ b/schedule.c @@ -23,8 +23,10 @@ static void enqueue_thread(struct thread *t) struct thread_list_node *node; for (node = nodes, i = 0; node->live && i < NUM_LIST_NODES; i++, node++); - if (i >= NUM_LIST_NODES) + if (i >= NUM_LIST_NODES) { printf("ran out of nodes\n"); + exit(1); + } node->this = t; node->next = NULL; node->live = 1;