[前][次][番号順一覧][スレッド一覧]

ruby-changes:55617

From: Nobuyoshi <ko1@a...>
Date: Mon, 29 Apr 2019 18:33:23 +0900 (JST)
Subject: [ruby-changes:55617] Nobuyoshi Nakada:6a3165e19d (trunk): Fixed HERETERM_LENGTH_MAX on IL32LLP64

https://git.ruby-lang.org/ruby.git/commit/?id=6a3165e19d

From 6a3165e19dfa21babfb2ef1f1c20c9930410b0ec Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 29 Apr 2019 18:32:21 +0900
Subject: Fixed HERETERM_LENGTH_MAX on IL32LLP64


diff --git a/parse.y b/parse.y
index fa869ab..a687163 100644
--- a/parse.y
+++ b/parse.y
@@ -613,9 +613,9 @@ struct rb_strterm_heredoc_struct { https://github.com/ruby/ruby/blob/trunk/parse.y#L613
     unsigned length	/* the length of END in `<<"END"` */
 #if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
     : HERETERM_LENGTH_BITS
+# define HERETERM_LENGTH_MAX ((1U << HERETERM_LENGTH_BITS) - 1)
 #else
-# undef HERETERM_LENGTH_BITS
-# define HERETERM_LENGTH_BITS (SIZEOF_INT * CHAR_BIT)
+# define HERETERM_LENGTH_MAX UINT_MAX
 #endif
     ;
     unsigned quote: 1;
@@ -6850,7 +6850,7 @@ heredoc_identifier(struct parser_params *p) https://github.com/ruby/ruby/blob/trunk/parse.y#L6850
     }
 
     len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
-    if ((unsigned long)len >= 1LU << HERETERM_LENGTH_BITS)
+    if ((unsigned long)len >= HERETERM_LENGTH_MAX)
 	yyerror(NULL, p, "too long here document identifier");
     dispatch_scan_event(p, tHEREDOC_BEG);
     lex_goto_eol(p);
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]