1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2015-06-24 08:28:47 +00:00
parent 4a8b048106
commit 43b5e3d7cd

3
load.c
View file

@ -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;
}