summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/string.c b/string.c
index fa5d2990fb..c6c1497ea4 100644
--- a/string.c
+++ b/string.c
@@ -136,6 +136,11 @@ VALUE
rb_fstring(VALUE str)
{
st_data_t fstr;
+ Check_Type(str, T_STRING);
+
+ if (FL_TEST(str, RSTRING_FSTR))
+ return str;
+
if (st_lookup(frozen_strings, (st_data_t)str, &fstr)) {
str = (VALUE)fstr;
/* because of lazy sweep, str may be unmaked already and swept