From: Ulya Trofimovich Date: Sat, 13 Jun 2015 10:51:19 +0000 (+0100) Subject: Explicitly shallow-copy ranges instead of using obscure copy constructor. X-Git-Tag: 0.15~211 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2515872e68d64dbdc4399437277c00903cc41f46;p=re2c Explicitly shallow-copy ranges instead of using obscure copy constructor. --- diff --git a/re2c/src/util/range.cc b/re2c/src/util/range.cc index f815ea57..c08c1f8a 100644 --- a/re2c/src/util/range.cc +++ b/re2c/src/util/range.cc @@ -18,11 +18,11 @@ Range *doUnion(Range *r1, Range *r2) if (r1->lb <= r2->lb) { - s = new Range(*r1); + s = new Range(r1->lb, r1->ub); } else { - s = new Range(*r2); + s = new Range(r2->lb, r2->ub); } *rP = s; diff --git a/re2c/src/util/range.h b/re2c/src/util/range.h index cef0dadb..2ce4bee1 100644 --- a/re2c/src/util/range.h +++ b/re2c/src/util/range.h @@ -25,11 +25,6 @@ public: vFreeList.insert(this); } - Range(Range &r) : next(NULL), lb(r.lb), ub(r.ub) - { - vFreeList.insert(this); - } - ~Range() { vFreeList.erase(this);