bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/9] style: reduce scopes


From: Akim Demaille
Subject: [PATCH 2/9] style: reduce scopes
Date: Sat, 13 Jun 2020 17:23:10 +0200

* src/scan-gram.l (STRING_GROW_ESCAPE): Move the static_assert about
type sizes here.
---
 src/scan-gram.l | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/scan-gram.l b/src/scan-gram.l
index 1bbcfd7d..655eee70 100644
--- a/src/scan-gram.l
+++ b/src/scan-gram.l
@@ -86,6 +86,7 @@ static boundary scanner_cursor;
 
 #define STRING_GROW_ESCAPE(Char)                                \
   do {                                                          \
+    verify (UCHAR_MAX < ULONG_MAX);                             \
     long c = Char;                                              \
     if (0 < c && c <= UCHAR_MAX)                                \
       obstack_1grow (&obstack_for_string, c);                   \
@@ -653,12 +654,10 @@ eqopt    ({sp}=)?
 <SC_ESCAPED_CHARACTER,SC_ESCAPED_STRING,SC_ESCAPED_TSTRING>
 {
   \\[0-7]{1,3} {
-    verify (UCHAR_MAX < ULONG_MAX);
     STRING_GROW_ESCAPE (strtol (yytext + 1, NULL, 8));
   }
 
   \\x[0-9abcdefABCDEF]+ {
-    verify (UCHAR_MAX < ULONG_MAX);
     STRING_GROW_ESCAPE (strtol (yytext + 2, NULL, 16));
   }
 
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]