File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -620,6 +620,26 @@ def rb_obj_instance_variables(object)
620
620
object . instance_variables
621
621
end
622
622
623
+ def rb_copy_generic_ivar ( clone , original )
624
+ Truffle . check_frozen ( clone )
625
+ original_ivars = original . instance_variables
626
+ clone_ivars = clone . instance_variables
627
+ clone_ivars . each do |var |
628
+ clone . __send__ :remove_instance_variable , var
629
+ end
630
+ original_ivars . each do |var |
631
+ clone . instance_variable_set ( var , original . instance_variable_get ( var ) )
632
+ end
633
+ end
634
+
635
+ def rb_free_generic_ivar ( original )
636
+ Truffle . check_frozen ( original )
637
+ original_ivars = original . instance_variables
638
+ original_ivars . each do |var |
639
+ original . __send__ :remove_instance_variable , var
640
+ end
641
+ end
642
+
623
643
def rb_inspect ( object )
624
644
Truffle ::Type . rb_inspect ( object )
625
645
end
Original file line number Diff line number Diff line change @@ -1276,6 +1276,9 @@ int rb_tr_flags(VALUE value) {
1276
1276
if (OBJ_TAINTED (value )) {
1277
1277
flags |= RUBY_FL_TAINT ;
1278
1278
}
1279
+ if (rb_array_len (rb_obj_instance_variables (value )) > 0 ) {
1280
+ flags |= RUBY_FL_EXIVAR ;
1281
+ }
1279
1282
// TODO BJF Nov-11-2017 Implement more flags
1280
1283
return flags ;
1281
1284
}
@@ -4403,11 +4406,11 @@ void rb_alias_variable(ID name1, ID name2) {
4403
4406
}
4404
4407
4405
4408
void rb_copy_generic_ivar (VALUE clone , VALUE obj ) {
4406
- rb_tr_error ("rb_copy_generic_ivar not implemented" );
4409
+ RUBY_CEXT_INVOKE_NO_WRAP ("rb_copy_generic_ivar" , clone , obj );
4407
4410
}
4408
4411
4409
4412
void rb_free_generic_ivar (VALUE obj ) {
4410
- rb_tr_error ("rb_free_generic_ivar not implemented" );
4413
+ RUBY_CEXT_INVOKE_NO_WRAP ("rb_free_generic_ivar" , obj );
4411
4414
}
4412
4415
4413
4416
void rb_ivar_foreach (VALUE obj , int (* func )(ANYARGS ), st_data_t arg ) {
You can’t perform that action at this time.
0 commit comments