summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-04-29 18:32:21 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-04-29 18:32:21 +0900
commit6a3165e19dfa21babfb2ef1f1c20c9930410b0ec (patch)
tree7c7475d08628a9d41bc5396bd350835c5a56e71f /parse.y
parentc7f780c155ac553aa026e6caf4b1c88ff988adde (diff)
Fixed HERETERM_LENGTH_MAX on IL32LLP64
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index fa869ab674..a687163aa9 100644
--- a/parse.y
+++ b/parse.y
@@ -613,9 +613,9 @@ struct rb_strterm_heredoc_struct {
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)
}
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);