]> granicus.if.org Git - re2c/commitdiff
Respect platforms with 32-bit 'long' and 64-bit pointers.
authorUlya Trofimovich <skvadrik@gmail.com>
Tue, 5 Mar 2019 10:50:00 +0000 (10:50 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Tue, 5 Mar 2019 10:50:00 +0000 (10:50 +0000)
Previously used ~0U works incorrectly in such cases: ~0U equals
0xFFFFffff, and maximum (numerical) pointer value is 0xFFFFffffFFFFffff.
This caused incorrect comparison result when tracking include files that
have been fully processed and can be removed frm the include stack.

Problem report thanks to Denis Naumov.

re2c/src/parse/scanner.cc

index 9194005de3dc32a40087753eb636bf9af99526c4..23dc65d822698232b83563e6f82c6dcd6d6f6a3e 100644 (file)
@@ -6,7 +6,7 @@
 
 namespace re2c {
 
-const char *const Scanner::ENDPOS = (const char*) ~0LU;
+const char *const Scanner::ENDPOS = (const char*) UINTMAX_MAX;
 
 Scanner::~Scanner()
 {