]> granicus.if.org Git - re2c/commitdiff
Explicitly shallow-copy ranges instead of using obscure copy constructor.
authorUlya Trofimovich <skvadrik@gmail.com>
Sat, 13 Jun 2015 10:51:19 +0000 (11:51 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sat, 13 Jun 2015 10:51:19 +0000 (11:51 +0100)
re2c/src/util/range.cc
re2c/src/util/range.h

index f815ea57d1c74df16d4c1c3cc3b11eb1d8fbe44a..c08c1f8a12973537af656e39796ba2e3636a7310 100644 (file)
@@ -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;
index cef0dadbd4616973ffab1608b045b3949b45d74a..2ce4bee1e54f667d30e8e700db2fd72042a895e1 100644 (file)
@@ -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);