aboutsummaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-27 00:12:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-27 00:12:33 +0000
commit04af7d260509b4bc00c24c78d02a8b60b3fcd829 (patch)
tree53603cd367b3610aa46f991b976f9dbadb8fe13b /object.c
parent3e635606e46aadaeed10d239dbee884a5bea92d1 (diff)
downloadruby-04af7d260509b4bc00c24c78d02a8b60b3fcd829.tar.gz
object.c: use converted string
* object.c (rb_convert_to_integer): should not drop the converted string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/object.c b/object.c
index fb8cee4071..228b67e8f8 100644
--- a/object.c
+++ b/object.c
@@ -2699,7 +2699,6 @@ rb_convert_to_integer(VALUE val, int base)
return val;
case T_STRING:
- string_conv:
return rb_str_to_inum(val, base, TRUE);
case T_NIL:
@@ -2712,7 +2711,7 @@ rb_convert_to_integer(VALUE val, int base)
}
if (base != 0) {
tmp = rb_check_string_type(val);
- if (!NIL_P(tmp)) goto string_conv;
+ if (!NIL_P(tmp)) return rb_str_to_inum(tmp, base, TRUE);
arg_error:
rb_raise(rb_eArgError, "base specified for non string value");
}