From c7d9eb0bb45e11da69c420488aa7af865f2ed5bd Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 22 Jun 2018 11:48:23 -0400 Subject: Huge numeric values that overflow should convert to infinity instead of zero. --- node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'node.c') diff --git a/node.c b/node.c index fcd2bf33..984cec81 100644 --- a/node.c +++ b/node.c @@ -140,7 +140,8 @@ r_force_number(NODE *n) *cpend = save; } - if (errno == 0) { + if (errno == 0 || errno == ERANGE) { + errno = 0; /* reset in case of ERANGE */ if (ptr == cpend) goto goodnum; /* else keep the leading numeric value without updating flags */ -- cgit v1.2.3