Index: src/base/ieee754.cc |
diff --git a/src/base/ieee754.cc b/src/base/ieee754.cc |
index 94bc7d350fe8cf8dffedd23b8fac70065b497913..d0faeeea0063ed701bb8853a35157be4203d066a 100644 |
--- a/src/base/ieee754.cc |
+++ b/src/base/ieee754.cc |
@@ -609,7 +609,7 @@ recompute: |
j = 0; |
for (i = jz - 1; i >= jk; i--) j |= iq[i]; |
if (j == 0) { /* need recomputation */ |
- for (k = 1; iq[jk - k] == 0; k++) { |
+ for (k = 1; jk >= k && iq[jk - k] == 0; k++) { |
/* k = no. of terms needed */ |
} |