From 43b5e3d7cddad91cb9fd2f583c926519ea39c90c Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 24 Jun 2015 08:28:47 +0000 Subject: [PATCH] load.c: use RB_GC_GUARD * load.c (rb_feature_provided): use RB_GC_GUARD for fullpath after last use of feature. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- load.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/load.c b/load.c index 02b4a68a89..69be692237 100644 --- a/load.c +++ b/load.c @@ -525,7 +525,7 @@ int rb_feature_provided(const char *feature, const char **loading) { const char *ext = strrchr(feature, '.'); - volatile VALUE fullpath = 0; + VALUE fullpath = 0; if (*feature == '.' && (feature[1] == '/' || strncmp(feature+1, "./", 2) == 0)) { @@ -544,6 +544,7 @@ rb_feature_provided(const char *feature, const char **loading) } if (rb_feature_p(feature, 0, TRUE, FALSE, loading)) return TRUE; + RB_GC_GUARD(fullpath); return FALSE; }