summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 04:31:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 04:31:54 +0000
commit19f143221cbcf5fb25b947081f98d93352194b7a (patch)
tree6d0126c07a016a3b5c40bd5cc1256696bfce167c /ext
parenta6144809eb6a71e31392b08cf75fd543bc85f5c7 (diff)
tkutil.c: GC guards
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): add GC guards instead of volatile after the uses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/tkutil/tkutil.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index 249ed57448f..1f0a720415b 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -1564,9 +1564,9 @@ cbsubst_table_setup(argc, argv, self)
VALUE self;
{
volatile VALUE cbsubst_obj;
- volatile VALUE key_inf;
- volatile VALUE longkey_inf;
- volatile VALUE proc_inf;
+ VALUE key_inf;
+ VALUE longkey_inf;
+ VALUE proc_inf;
VALUE inf, subst, name, type, ivar, proc;
const VALUE *infp;
ID id;
@@ -1616,6 +1616,7 @@ cbsubst_table_setup(argc, argv, self)
rb_attr(self, id, 1, 0, Qtrue);
}
+ RB_GC_GUARD(key_inf);
/*
@@ -1647,6 +1648,7 @@ cbsubst_table_setup(argc, argv, self)
rb_attr(self, id, 1, 0, Qtrue);
}
+ RB_GC_GUARD(longkey_inf);
/*
* procs : array of [type, proc]
@@ -1663,6 +1665,7 @@ cbsubst_table_setup(argc, argv, self)
type = INT2FIX(*(RSTRING_PTR(type)));
rb_hash_aset(subst_inf->proc, type, proc);
}
+ RB_GC_GUARD(proc_inf);
rb_const_set(self, ID_SUBST_INFO, cbsubst_obj);