summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--process.c6
-rw-r--r--re.c4
-rw-r--r--signal.c9
3 files changed, 12 insertions, 7 deletions
diff --git a/process.c b/process.c
index e9d1b0638f..bcccddcdcd 100644
--- a/process.c
+++ b/process.c
@@ -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:
diff --git a/re.c b/re.c
index 4bf18f5e84..d110fe63ef 100644
--- a/re.c
+++ b/re.c
@@ -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);
diff --git a/signal.c b/signal.c
index bf1b5d3dfc..3017061046 100644
--- a/signal.c
+++ b/signal.c
@@ -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;