From: Ulya Trofimovich Date: Mon, 15 Jun 2015 14:09:02 +0000 (+0100) Subject: Crash on attempt to create range with lower bound greater or equal to lower bound. X-Git-Tag: 0.15~208 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ecdfb66f47c0d0ecf22c587378ac266a2d9bbf4;p=re2c 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. --- 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 ()