diff options
author | otto <> | 2006-10-01 11:36:33 +0000 |
---|---|---|
committer | otto <> | 2006-10-01 11:36:33 +0000 |
commit | c2d940ce6f2c3ef66262b7c1953e6286cf68b267 (patch) | |
tree | 0629364e2cf49c382cfc734695499c70787ec257 | |
parent | b111751208a94882547ae748c16e7978fa7226b6 (diff) | |
download | openbsd-c2d940ce6f2c3ef66262b7c1953e6286cf68b267.tar.gz openbsd-c2d940ce6f2c3ef66262b7c1953e6286cf68b267.tar.bz2 openbsd-c2d940ce6f2c3ef66262b7c1953e6286cf68b267.zip |
Make a var volatile, which forces a mem write at the right spot, and
detctecion of underflow where it would otherwise not happen for FPUs
that have a larger register size than sizeof double (i386, m68k). ok
deraadt@ weingart@ kettenis@
-rw-r--r-- | src/lib/libc/stdlib/strtod.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/strtod.c b/src/lib/libc/stdlib/strtod.c index d01158e10c..3081cb5cc7 100644 --- a/src/lib/libc/stdlib/strtod.c +++ b/src/lib/libc/stdlib/strtod.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: strtod.c,v 1.22 2006/05/19 14:15:27 thib Exp $ */ | 1 | /* $OpenBSD: strtod.c,v 1.23 2006/10/01 11:36:33 otto Exp $ */ |
2 | /**************************************************************** | 2 | /**************************************************************** |
3 | * | 3 | * |
4 | * The author of this software is David M. Gay. | 4 | * The author of this software is David M. Gay. |
@@ -1128,7 +1128,12 @@ strtod(CONST char *s00, char **se) | |||
1128 | e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; | 1128 | e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; |
1129 | CONST char *s, *s0, *s1; | 1129 | CONST char *s, *s0, *s1; |
1130 | double aadj, aadj1, adj; | 1130 | double aadj, aadj1, adj; |
1131 | _double rv, rv0; | 1131 | /* |
1132 | * volatile forces mem update for FPUs where reg size != sizeof double, | ||
1133 | * which should trigger ERANGE in the case of underflow. | ||
1134 | */ | ||
1135 | volatile _double rv; | ||
1136 | _double rv0; | ||
1132 | Long L; | 1137 | Long L; |
1133 | ULong y, z; | 1138 | ULong y, z; |
1134 | Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; | 1139 | Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; |