From: Brian Norris Date: Sat, 23 Feb 2013 00:34:37 +0000 (-0800) Subject: nodestack: don't use C++ references X-Git-Tag: oopsla2013~228 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ad07f2838b1b4b87c84f04ee67e0a28677a734ba;p=model-checker.git nodestack: don't use C++ references Just pass-by-value, since the reference can obfuscate the lifetime of, for example, an automatic variable. --- diff --git a/nodestack.cc b/nodestack.cc index b2ef73c..59e9b5d 100644 --- a/nodestack.cc +++ b/nodestack.cc @@ -226,7 +226,7 @@ bool Node::misc_empty() const * @param value is the value to backtrack to. * @return True if the future value was successully added; false otherwise */ -bool Node::add_future_value(struct future_value& fv) +bool Node::add_future_value(struct future_value fv) { uint64_t value = fv.value; modelclock_t expiration = fv.expiration; diff --git a/nodestack.h b/nodestack.h index 47c7267..cd34ba4 100644 --- a/nodestack.h +++ b/nodestack.h @@ -71,7 +71,7 @@ public: * occurred previously in the stack. */ Node * get_parent() const { return parent; } - bool add_future_value(struct future_value& fv); + bool add_future_value(struct future_value fv); struct future_value get_future_value() const; bool increment_future_value(); bool future_value_empty() const;