Remove needless check
`nodetype_markable_p` always returns `false` then `rb_ast_node_type_change` never calls `rb_bug`.
This commit is contained in:
parent
fc8fe78c07
commit
cebbe18eed
22
node.c
22
node.c
@ -283,25 +283,6 @@ rb_ast_newnode(rb_ast_t *ast, enum node_type type, size_t size, size_t alignment
|
|||||||
return ast_newnode_in_bucket(ast, bucket, size, alignment);
|
return ast_newnode_in_bucket(ast, bucket, size, alignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if RUBY_DEBUG
|
|
||||||
RBIMPL_ATTR_PURE()
|
|
||||||
static bool
|
|
||||||
nodetype_markable_p(enum node_type type)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
rb_ast_node_type_change(NODE *n, enum node_type type)
|
|
||||||
{
|
|
||||||
enum node_type old_type = nd_type(n);
|
|
||||||
if (nodetype_markable_p(old_type) != nodetype_markable_p(type)) {
|
|
||||||
rb_bug("node type changed: %s -> %s",
|
|
||||||
ruby_node_name(old_type), ruby_node_name(type));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rb_ast_id_table_t *
|
rb_ast_id_table_t *
|
||||||
rb_ast_new_local_table(rb_ast_t *ast, int size)
|
rb_ast_new_local_table(rb_ast_t *ast, int size)
|
||||||
{
|
{
|
||||||
@ -421,8 +402,5 @@ rb_ast_dispose(rb_ast_t *ast)
|
|||||||
VALUE
|
VALUE
|
||||||
rb_node_set_type(NODE *n, enum node_type t)
|
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);
|
return nd_init_type(n, t);
|
||||||
}
|
}
|
||||||
|
3
node.h
3
node.h
@ -53,9 +53,6 @@ rb_ast_t *rb_ast_new(void);
|
|||||||
#endif
|
#endif
|
||||||
size_t rb_ast_memsize(const rb_ast_t*);
|
size_t rb_ast_memsize(const rb_ast_t*);
|
||||||
void rb_ast_dispose(rb_ast_t*);
|
void rb_ast_dispose(rb_ast_t*);
|
||||||
#if RUBY_DEBUG
|
|
||||||
void rb_ast_node_type_change(NODE *n, enum node_type type);
|
|
||||||
#endif
|
|
||||||
const char *ruby_node_name(int node);
|
const char *ruby_node_name(int node);
|
||||||
void rb_node_init(NODE *n, enum node_type type);
|
void rb_node_init(NODE *n, enum node_type type);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user