aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-23 16:58:27 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-23 16:58:27 +0000
commit6da2e4df933976e28dfd787d45a5b30171563452 (patch)
tree032fe951aa2e35bcd3285b35686d76f3b20472e6
parent24b0b1eadb0c1a09af4fb9c4ea85b57e021b878f (diff)
downloadruby-6da2e4df933976e28dfd787d45a5b30171563452.tar.gz
Prevent GC by volatile [Bug #13150]
test/ruby/test_marshal.rb test_context_switch (load) and test_gc (dump) are failed on FreeBSD 10.3 and gcc7 (FreeBSD Ports Collection) 7.0.0 20170115 (experimental); RB_GC_GUARD looks not worked well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--marshal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/marshal.c b/marshal.c
index a9926acf56..d628daa4de 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1024,7 +1024,7 @@ VALUE
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 */
+ volatile VALUE wrapper; /* used to avoid memory leak in case of exception */
wrapper = TypedData_Make_Struct(rb_cData, struct dump_arg, &dump_arg_data, arg);
arg->dest = 0;
@@ -2038,7 +2038,7 @@ rb_marshal_load_with_proc(VALUE port, VALUE proc)
{
int major, minor, infection = 0;
VALUE v;
- VALUE wrapper; /* used to avoid memory leak in case of exception */
+ volatile VALUE wrapper; /* used to avoid memory leak in case of exception */
struct load_arg *arg;
v = rb_check_string_type(port);