From 2515872e68d64dbdc4399437277c00903cc41f46 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sat, 13 Jun 2015 11:51:19 +0100 Subject: [PATCH] Explicitly shallow-copy ranges instead of using obscure copy constructor. --- re2c/src/util/range.cc | 4 ++-- re2c/src/util/range.h | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) 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); -- 2.40.0