mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
NODE markability should not change by nd_set_type
This commit is contained in:
parent
e1fee7f949
commit
c060bdc2b4
Notes:
git
2021-01-14 16:59:48 +09:00
2 changed files with 37 additions and 6 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