diff --git a/include/ruby/internal/fl_type.h b/include/ruby/internal/fl_type.h index 6d8df59a25..455448fe8d 100644 --- a/include/ruby/internal/fl_type.h +++ b/include/ruby/internal/fl_type.h @@ -52,6 +52,7 @@ #define FL_PROMOTED1 RBIMPL_CAST((VALUE)RUBY_FL_PROMOTED1) #define FL_FINALIZE RBIMPL_CAST((VALUE)RUBY_FL_FINALIZE) #define FL_TAINT RBIMPL_CAST((VALUE)RUBY_FL_TAINT) +#define FL_SHAREABLE RBIMPL_CAST((VALUE)RUBY_FL_SHAREABLE) #define FL_UNTRUSTED RBIMPL_CAST((VALUE)RUBY_FL_UNTRUSTED) #define FL_SEEN_OBJ_ID RBIMPL_CAST((VALUE)RUBY_FL_SEEN_OBJ_ID) #define FL_EXIVAR RBIMPL_CAST((VALUE)RUBY_FL_EXIVAR) diff --git a/spec/ruby/optional/capi/ext/rbasic_spec.c b/spec/ruby/optional/capi/ext/rbasic_spec.c index 05eca76ba7..cf10904294 100644 --- a/spec/ruby/optional/capi/ext/rbasic_spec.c +++ b/spec/ruby/optional/capi/ext/rbasic_spec.c @@ -5,7 +5,11 @@ extern "C" { #endif +#ifndef FL_SHAREABLE static const VALUE VISIBLE_BITS = FL_TAINT | FL_FREEZE | ~(FL_USER0 - 1); +#else +static const VALUE VISIBLE_BITS = FL_FREEZE | ~(FL_USER0 - 1); +#endif #if SIZEOF_VALUE == SIZEOF_LONG #define VALUE2NUM(v) ULONG2NUM(v) diff --git a/spec/ruby/optional/capi/shared/rbasic.rb b/spec/ruby/optional/capi/shared/rbasic.rb index c25733f862..f202b72f33 100644 --- a/spec/ruby/optional/capi/shared/rbasic.rb +++ b/spec/ruby/optional/capi/shared/rbasic.rb @@ -66,9 +66,9 @@ describe :rbasic, shared: true do obj1, obj2 = @data.call initial = @specs.get_flags(obj1) @specs.get_flags(obj2).should == initial - @specs.set_flags(obj1, @taint | 1 << 14 | 1 << 16 | initial) + @specs.set_flags(obj1, 1 << 14 | 1 << 16 | initial) @specs.copy_flags(obj2, obj1) - @specs.get_flags(obj2).should == @taint | 1 << 14 | 1 << 16 | initial + @specs.get_flags(obj2).should == 1 << 14 | 1 << 16 | initial @specs.set_flags(obj1, initial) @specs.copy_flags(obj2, obj1) @specs.get_flags(obj2).should == initial