projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mymemory: reword comments
[model-checker.git]
/
nodestack.cc
diff --git
a/nodestack.cc
b/nodestack.cc
index b33d24739ca89399ffb363c1ba3bdecd61ca6dc2..d5425e335dad86614b4e09db71717e0b00dfe2d2 100644
(file)
--- a/
nodestack.cc
+++ b/
nodestack.cc
@@
-325,8
+325,11
@@
const ModelAction * Node::get_read_from() {
bool Node::increment_read_from() {
DBG();
promises.clear();
bool Node::increment_read_from() {
DBG();
promises.clear();
- read_from_index++;
- return (read_from_index < may_read_from.size());
+ if (read_from_index < may_read_from.size()) {
+ read_from_index++;
+ return read_from_index < may_read_from.size();
+ }
+ return false;
}
/**
}
/**
@@
-336,8
+339,11
@@
bool Node::increment_read_from() {
bool Node::increment_future_value() {
DBG();
promises.clear();
bool Node::increment_future_value() {
DBG();
promises.clear();
- future_index++;
- return (future_index < (int)future_values.size());
+ if (future_index < ((int)future_values.size())) {
+ future_index++;
+ return (future_index < ((int)future_values.size()));
+ }
+ return false;
}
void Node::explore(thread_id_t tid)
}
void Node::explore(thread_id_t tid)
@@
-412,6
+418,8
@@
void NodeStack::pop_restofstack(int numAhead)
{
/* Diverging from previous execution; clear out remainder of list */
unsigned int it=iter+numAhead;
{
/* Diverging from previous execution; clear out remainder of list */
unsigned int it=iter+numAhead;
+ for(unsigned int i=it;i<node_list.size();i++)
+ delete node_list[i];
node_list.resize(it);
}
node_list.resize(it);
}