mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 17:43:59 +02:00
merge revision(s) 6bcc4664bdaebbf9b28a762ae63f476a1ec6cfb2,bb40c5cbe977de9f36a2a739e94e9b2fd4496b6e,c060bdc2b4ab8eeef5374f4174f5de48ab936d74: [Backport #17541]
Return new NODE_LIT As NODE_ZLIST/NODE_LIST are not markable, cannot be reused as NODE_LIT. --- parse.y | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) Ensure symbol list node is either NODE_STR or NODE_DSTR --- parse.y | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) NODE markability should not change by nd_set_type --- node.c | 31 +++++++++++++++++++++++++------ node.h | 12 ++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-)
This commit is contained in:
parent
1b0622d7a9
commit
42f02a0bac
4 changed files with 48 additions and 15 deletions
12
node.h
12
node.h
|
@ -187,6 +187,8 @@ typedef struct RNode {
|
|||
|
||||
#define nd_type(n) ((int) (((n)->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT))
|
||||
#define nd_set_type(n,t) \
|
||||
rb_node_set_type(n, t)
|
||||
#define nd_init_type(n,t) \
|
||||
(n)->flags=(((n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))<<NODE_TYPESHIFT)&NODE_TYPEMASK))
|
||||
|
||||
#define NODE_LSHIFT (NODE_TYPESHIFT+7)
|
||||
|
@ -471,9 +473,19 @@ void *rb_parser_realloc(struct parser_params *, void *, size_t);
|
|||
void *rb_parser_calloc(struct parser_params *, size_t, size_t);
|
||||
void rb_parser_free(struct parser_params *, void *);
|
||||
PRINTF_ARGS(void rb_parser_printf(struct parser_params *parser, const char *fmt, ...), 2, 3);
|
||||
void rb_ast_node_type_change(NODE *n, enum node_type type);
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
static inline VALUE
|
||||
rb_node_set_type(NODE *n, enum node_type t)
|
||||
{
|
||||
#if RUBY_DEBUG
|
||||
rb_ast_node_type_change(n, t);
|
||||
#endif
|
||||
return nd_init_type(n, t);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue