To be consistent, and to prevent unecessary merging work, we should
simply return from the mergeNodes() function as soon as we know it has
failed.
/* Transfer the RMW */
CycleNode *promise_rmw = p_node->getRMW();
- if (promise_rmw && promise_rmw != w_node->getRMW() && w_node->setRMW(promise_rmw))
+ if (promise_rmw && promise_rmw != w_node->getRMW() && w_node->setRMW(promise_rmw)) {
hasCycles = true;
+ return false;
+ }
/* Transfer back edges to w_node */
while (p_node->getNumBackEdges() > 0) {