ruby-changes:39854
From: nobu <ko1@a...>
Date: Fri, 25 Sep 2015 16:09:02 +0900 (JST)
Subject: [ruby-changes:39854] nobu:r51935 (trunk): hash.c: GC guards
nobu 2015-09-25 16:08:45 +0900 (Fri, 25 Sep 2015) New Revision: 51935 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51935 Log: hash.c: GC guards * hash.c (env_delete, env_aset): prevent environment variable names from GC while ruby_setenv. Modified files: trunk/hash.c Index: hash.c =================================================================== --- hash.c (revision 51934) +++ hash.c (revision 51935) @@ -2816,6 +2816,7 @@ env_delete(VALUE obj, VALUE name) https://github.com/ruby/ruby/blob/trunk/hash.c#L2816 ruby_setenv(nam, 0); if (ENVMATCH(nam, PATH_ENV)) { + RB_GC_GUARD(name); path_tainted = 0; } return value; @@ -3151,6 +3152,7 @@ env_aset(VALUE obj, VALUE nm, VALUE val) https://github.com/ruby/ruby/blob/trunk/hash.c#L3152 ruby_setenv(name, value); if (ENVMATCH(name, PATH_ENV)) { + RB_GC_GUARD(nm); if (OBJ_TAINTED(val)) { /* already tainted, no check */ path_tainted = 1; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/