From af41ce23eaacb4697216ad8bb5975fc97a06147b Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 13 Mar 2017 07:03:32 +0000 Subject: merge revision(s) 57269,57277: bignum.c: fix rb_cstr_parse_inum endp * bignum.c (rb_cstr_parse_inum): stores the address of the first invalid character when str is too big or contains an underscore. bignum.c: unnecessary check * bignum.c (rb_cstr_parse_inum): remove unnecessary check. successive sign is rejected by conv_digit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bignum.c | 4 +--- version.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bignum.c b/bignum.c index a5983c4ba9..4b50737bb6 100644 --- a/bignum.c +++ b/bignum.c @@ -4057,9 +4057,6 @@ rb_cstr_parse_inum(const char *str, ssize_t len, char **endp, int base) sign = 0; } ASSERT_LEN(); - if (str[0] == '+' || str[0] == '-') { - goto bad; - } } if (base <= 0) { if (str[0] == '0' && len > 1) { @@ -4172,6 +4169,7 @@ rb_cstr_parse_inum(const char *str, ssize_t len, char **endp, int base) digits_start = str; if (!str2big_scan_digits(s, str, base, badcheck, &num_digits, &len)) goto bad; + if (endp) *endp = (char *)(str + len); digits_end = digits_start + len; if (POW2_P(base)) { diff --git a/version.h b/version.h index 1bc29c45e9..0a845df844 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.4.0" #define RUBY_RELEASE_DATE "2017-03-13" -#define RUBY_PATCHLEVEL 98 +#define RUBY_PATCHLEVEL 99 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 3 -- cgit v1.2.3