File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -784,13 +784,7 @@ static const rb_data_type_t ast_data_type = {
784
784
static VALUE
785
785
ast_alloc (void )
786
786
{
787
- rb_ast_t * ast ;
788
- VALUE vast = TypedData_Make_Struct (0 , rb_ast_t , & ast_data_type , ast );
789
- #ifdef UNIVERSAL_PARSER
790
- ast = (rb_ast_t * )DATA_PTR (vast );
791
- ast -> config = & rb_global_parser_config ;
792
- #endif
793
- return vast ;
787
+ return TypedData_Wrap_Struct (0 , & ast_data_type , NULL );
794
788
}
795
789
796
790
VALUE
@@ -1142,8 +1136,11 @@ parser_aset_script_lines_for(VALUE path, rb_parser_ary_t *lines)
1142
1136
VALUE
1143
1137
rb_ruby_ast_new (const NODE * const root )
1144
1138
{
1145
- VALUE vast = ast_alloc ();
1146
- rb_ast_t * ast = DATA_PTR (vast );
1139
+ rb_ast_t * ast ;
1140
+ VALUE vast = TypedData_Make_Struct (0 , rb_ast_t , & ast_data_type , ast );
1141
+ #ifdef UNIVERSAL_PARSER
1142
+ ast -> config = & rb_global_parser_config ;
1143
+ #endif
1147
1144
ast -> body = (rb_ast_body_t ){
1148
1145
.root = root ,
1149
1146
.frozen_string_literal = -1 ,
You can’t perform that action at this time.
0 commit comments