From 662e3cf1f94bb50f6a27568c7526f867956e5b55 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 9 Jul 2003 22:28:42 +0000 Subject: * eval.c (rb_load): put rb_load_file() in a thread critical section. [ruby-dev:20490] * eval.c (compile): put rb_compile_string() in a thread critical section. * variable.c (rb_const_get_0): should not warn if constant is not defined. (ruby-bugs-ja PR#509) * bignum.c (rb_big2dbl): give a warning on overflow. (ruby-bugs-ja PR#510) * util.c (ruby_strtod): change MDMAXEXPT from 511 to 308. * pack.c (utf8_to_uv): long is sufficient. LONG_LONG is not required. * bignum.c (rb_big2str): support 32 bit (without `long long' type) machines. (ruby-bugs-ja PR#512) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'object.c') diff --git a/object.c b/object.c index 0e1c1a72ab..7e8b5e68e1 100644 --- a/object.c +++ b/object.c @@ -1140,6 +1140,10 @@ rb_cstr_to_dbl(p, badcheck) while (ISSPACE(*p) || *p == '_') p++; } d = strtod(p, &end); + if (errno == ERANGE) { + rb_warn("Float %*s out of range", end-p, p); + errno = 0; + } if (p == end) { if (badcheck) { bad: @@ -1170,6 +1174,10 @@ rb_cstr_to_dbl(p, badcheck) *n = '\0'; p = buf; d = strtod(p, &end); + if (errno == ERANGE) { + rb_warn("Float %*s out of range", end-p, p); + errno = 0; + } if (badcheck) { if (p == end) goto bad; while (*end && ISSPACE(*end)) end++; -- cgit v1.2.3