summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 06:53:14 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 06:53:14 (GMT)
commit002f6ea856f14d516b8e5e9c8d15f38240ece738 (patch)
tree6dcc2c09774195797a31ea4544fb4a9202b8000e /ast.c
parent64712906b063d5470f74ef0b19d16e4aa84defdf (diff)
ast.c: allocator of Node
* ast.c (Init_ast): undefine allocator of Node, as a method call on an uninitialized Node causes segfault. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ast.c b/ast.c
index 585e495..ec9a98b 100644
--- a/ast.c
+++ b/ast.c
@@ -614,8 +614,7 @@ Init_ast(void)
*/
rb_cNode = rb_define_class_under(rb_mAST, "Node", rb_cObject);
- rb_define_alloc_func(rb_cNode, rb_ast_node_alloc);
- rb_undef_method(CLASS_OF(rb_cNode), "new");
+ rb_undef_alloc_func(rb_cNode);
rb_define_singleton_method(rb_mAST, "parse", rb_ast_s_parse, 1);
rb_define_singleton_method(rb_mAST, "parse_file", rb_ast_s_parse_file, 1);
rb_define_method(rb_cNode, "type", rb_ast_node_type, 0);