parse.y: fix r60644
* parse.y (rb_strterm_heredoc_t): should not define sourceline as union, to fix wrong read on big-endian platforms. as rb_imemo_new stores all members as VALUEs, should read it as VALUE too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b887848188
commit
cf3329cb8d
7
parse.y
7
parse.y
@ -757,10 +757,7 @@ typedef struct rb_strterm_literal_struct {
|
|||||||
} rb_strterm_literal_t;
|
} rb_strterm_literal_t;
|
||||||
|
|
||||||
typedef struct rb_strterm_heredoc_struct {
|
typedef struct rb_strterm_heredoc_struct {
|
||||||
union {
|
SIGNED_VALUE sourceline;
|
||||||
VALUE dummy;
|
|
||||||
int sourceline;
|
|
||||||
} u1;
|
|
||||||
VALUE term; /* `"END"` of `<<"END"` */
|
VALUE term; /* `"END"` of `<<"END"` */
|
||||||
VALUE lastline; /* the string of line that contains `<<"END"` */
|
VALUE lastline; /* the string of line that contains `<<"END"` */
|
||||||
union {
|
union {
|
||||||
@ -6793,7 +6790,7 @@ parser_heredoc_restore(struct parser_params *parser, rb_strterm_heredoc_t *here)
|
|||||||
lex_pend = lex_pbeg + RSTRING_LEN(line);
|
lex_pend = lex_pbeg + RSTRING_LEN(line);
|
||||||
lex_p = lex_pbeg + here->u3.lastidx;
|
lex_p = lex_pbeg + here->u3.lastidx;
|
||||||
heredoc_end = ruby_sourceline;
|
heredoc_end = ruby_sourceline;
|
||||||
ruby_sourceline = here->u1.sourceline;
|
ruby_sourceline = (int)here->sourceline;
|
||||||
token_flush(parser);
|
token_flush(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user