summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2014-11-08 15:13:24 -0500
committerMorgan Deters <mdeters@cs.nyu.edu>2014-11-09 18:53:29 -0500
commit5c99a9b0fb5f8c0f0aabc8ddcee1cbb93d493eca (patch)
tree23699b1fa483a51a581f029b975548001c1d3002
parent36ff166f3d2976ad13536de8c699e86d1ff99e65 (diff)
Work around an apparent bug in libc++ that was causing crashes on Mac..
-rw-r--r--src/expr/node_manager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp
index fb1284d0d..2b6feafa5 100644
--- a/src/expr/node_manager.cpp
+++ b/src/expr/node_manager.cpp
@@ -202,10 +202,21 @@ void NodeManager::reclaimZombies() {
NodeValueReferenceCountNonZero());
d_zombies.clear();
+#ifdef _LIBCPP_VERSION
+ NodeValue* last = NULL;
+#endif
for(vector<NodeValue*>::iterator i = zombies.begin();
i != zombies.end();
++i) {
NodeValue* nv = *i;
+#ifdef _LIBCPP_VERSION
+ // Work around an apparent bug in libc++'s hash_set<> which can
+ // (very occasionally) have an element repeated.
+ if(nv == last) {
+ continue;
+ }
+ last = nv;
+#endif
// collect ONLY IF still zero
if(nv->d_rc == 0) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback