diff options
-rw-r--r-- | process.c | 6 | ||||
-rw-r--r-- | re.c | 4 | ||||
-rw-r--r-- | signal.c | 9 |
3 files changed, 12 insertions, 7 deletions
@@ -4529,7 +4529,8 @@ rlimit_resource_type(VALUE rtype) switch (TYPE(rtype)) { case T_SYMBOL: - name = RSTRING_PTR(rb_sym2str(rtype)); + v = rb_sym2str(rtype); + name = RSTRING_PTR(v); break; default: @@ -4564,7 +4565,8 @@ rlimit_resource_value(VALUE rval) switch (TYPE(rval)) { case T_SYMBOL: - name = RSTRING_PTR(rb_sym2str(rval)); + v = rb_sym2str(rval); + name = RSTRING_PTR(v); break; default: @@ -1082,8 +1082,8 @@ match_backref_number(VALUE match, VALUE backref) return NUM2INT(backref); case T_SYMBOL: - name = RSTRING_PTR(rb_sym2str(backref)); - break; + backref = rb_sym2str(backref); + /* fall through */ case T_STRING: name = StringValueCStr(backref); @@ -301,7 +301,8 @@ esignal_init(int argc, VALUE *argv, VALUE self) } else { int len = sizeof(signame_prefix); - signm = SYMBOL_P(sig) ? RSTRING_PTR(rb_sym2str(sig)) : StringValuePtr(sig); + if (SYMBOL_P(sig)) sig = rb_sym2str(sig); else StringValue(sig); + signm = RSTRING_PTR(sig); if (strncmp(signm, signame_prefix, len) == 0) { signm += len; len = 0; @@ -408,7 +409,8 @@ rb_f_kill(int argc, const VALUE *argv) break; case T_SYMBOL: - s = RSTRING_PTR(rb_sym2str(argv[0])); + str = rb_sym2str(argv[0]); + s = RSTRING_PTR(str); if (!s) rb_raise(rb_eArgError, "bad signal"); goto str_signal; @@ -1044,7 +1046,8 @@ trap_signm(VALUE vsig) break; case T_SYMBOL: - s = RSTRING_PTR(rb_sym2str(vsig)); + vsig = rb_sym2str(vsig); + s = RSTRING_PTR(vsig); if (!s) rb_raise(rb_eArgError, "bad signal"); goto str_signal; |