diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-27 08:13:31 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-27 08:13:31 +0000 |
commit | 516f8f355e94dd716ac187e86a9bef2e26f1550b (patch) | |
tree | 568be25c4587e2f35cca1befb07f94dda42325ad /rational.c | |
parent | 52832c4db06949623620033c9383413707e7d205 (diff) |
merge revision(s) 45793: [Backport #9608]
* complex.c (parse_comp): replace ALLOCA_N with ALLOCV_N/ALLOCV_END
[Bug #9608]
* rational.c (read_digits): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rational.c b/rational.c index dd5d24dc69..f359665f7f 100644 --- a/rational.c +++ b/rational.c @@ -2070,13 +2070,14 @@ read_digits(const char **s, int strict, { char *b, *bb; int us = 1, ret = 1; + VALUE tmp; if (!isdecimal(**s)) { *num = ZERO; return 0; } - bb = b = ALLOCA_N(char, strlen(*s) + 1); + bb = b = ALLOCV_N(char, tmp, strlen(*s) + 1); while (isdecimal(**s) || **s == '_') { if (**s == '_') { @@ -2103,6 +2104,7 @@ read_digits(const char **s, int strict, conv: *b = '\0'; *num = rb_cstr_to_inum(bb, 10, 0); + ALLOCV_END(tmp); return ret; } |