From 1ecdfb66f47c0d0ecf22c587378ac266a2d9bbf4 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 15 Jun 2015 15:09:02 +0100 Subject: [PATCH] Crash on attempt to create range with lower bound greater or equal to lower bound. Better have an assert than nothing until we handle such cases properly. As for now, if the user inputs range like [9-0], it will be tranformed to [0-9]. Later re2c should at least warn about such cases. --- re2c/src/util/range.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/re2c/src/util/range.h b/re2c/src/util/range.h index b768cf23..48d79f38 100644 --- a/re2c/src/util/range.h +++ b/re2c/src/util/range.h @@ -1,6 +1,7 @@ #ifndef _RE2C_UTIL_RANGE_ #define _RE2C_UTIL_RANGE_ +#include #include // NULL #include "src/util/c99_stdint.h" @@ -27,6 +28,7 @@ public: , lb (l) , ub (u) { + assert (lb < ub); vFreeList.insert (this); } ~Range () -- 2.40.0