diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-04 07:48:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-04 07:48:22 +0000 |
commit | cae3905e89ebfbfffa181bf94c3ed4550ef87619 (patch) | |
tree | 4812f00c869bd0581479fc8c8e5cbe8bfa13a87f /string.c | |
parent | 7eb6942dbb0b2567739b6dba7c94741d14501c52 (diff) |
string.c: should not taint fstring
* string.c (rb_obj_as_string): fstring should not be infected.
re-apply r52872 and fix a typo.
TODO: other frozen strings also may not be.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1247,7 +1247,9 @@ rb_obj_as_string(VALUE obj) str = rb_funcall(obj, idTo_s, 0); if (!RB_TYPE_P(str, T_STRING)) return rb_any_to_s(obj); - OBJ_INFECT(str, obj); + if (!FL_TEST_RAW(str, RSTRING_FSTR) && FL_ABLE(obj)) + /* fstring must not be tainted, at least */ + OBJ_INFECT_RAW(str, obj); return str; } |