aboutsummaryrefslogtreecommitdiffstats
path: root/transcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'transcode.c')
-rw-r--r--transcode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/transcode.c b/transcode.c
index cd4829f291..17bad37e27 100644
--- a/transcode.c
+++ b/transcode.c
@@ -2711,7 +2711,9 @@ str_encode_bang(int argc, VALUE *argv, VALUE str)
VALUE newstr;
int encidx;
- rb_check_frozen(str);
+ if (OBJ_FROZEN(str)) { /* in future, may use str_frozen_check from string.c, but that's currently static */
+ rb_raise(rb_eRuntimeError, "string frozen");
+ }
newstr = str;
encidx = str_transcode(argc, argv, &newstr);