diff options
| -rw-r--r-- | include/ruby/ruby.h | 6 | ||||
| -rw-r--r-- | marshal.c | 4 | ||||
| -rw-r--r-- | test/ruby/test_marshal.rb | 3 | ||||
| -rw-r--r-- | version.h | 2 |
4 files changed, 11 insertions, 4 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 6144c67234..4aa388849b 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -536,7 +536,11 @@ static inline int rb_type(VALUE obj); #ifdef __GNUC__ #define RB_GC_GUARD(v) \ - (*__extension__ ({volatile VALUE *rb_gc_guarded_ptr = &(v); rb_gc_guarded_ptr;})) + (*__extension__ ({ \ + volatile VALUE *rb_gc_guarded_ptr = &(v); \ + __asm__("" : : "m"(rb_gc_guarded_ptr)); \ + rb_gc_guarded_ptr; \ + })) #elif defined _MSC_VER #pragma optimize("", off) static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;} @@ -1026,7 +1026,7 @@ rb_marshal_dump_limited(VALUE obj, VALUE port, int limit) struct dump_arg *arg; VALUE wrapper; /* used to avoid memory leak in case of exception */ - wrapper = TypedData_Make_Struct(rb_cData, struct dump_arg, &dump_arg_data, arg); + wrapper = TypedData_Make_Struct(0, struct dump_arg, &dump_arg_data, arg); arg->dest = 0; arg->symbols = st_init_numtable(); arg->data = rb_init_identtable(); @@ -2053,7 +2053,7 @@ rb_marshal_load_with_proc(VALUE port, VALUE proc) else { io_needed(); } - wrapper = TypedData_Make_Struct(rb_cData, struct load_arg, &load_arg_data, arg); + wrapper = TypedData_Make_Struct(0, struct load_arg, &load_arg_data, arg); arg->infection = infection; arg->src = port; arg->offset = 0; diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index bc22b5fd3a..bfc3f6df25 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -644,6 +644,9 @@ class TestMarshal < Test::Unit::TestCase c = Bug9523.new assert_raise_with_message(RuntimeError, /Marshal\.dump reentered at marshal_dump/) do Marshal.dump(c) + GC.start + 1000.times {"x"*1000} + GC.start c.cc.call end end @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.4.0" #define RUBY_RELEASE_DATE "2017-03-13" -#define RUBY_PATCHLEVEL 99 +#define RUBY_PATCHLEVEL 100 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 3 |
