summaryrefslogtreecommitdiff
path: root/src/cmd/gc/align.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-11-15 12:57:09 -0800
committerRuss Cox <rsc@golang.org>2009-11-15 12:57:09 -0800
commit7b1e1f5210264d7a6fcfca501ad5d95c3c46471c (patch)
tree4df91b85cdb8c5bfe3bb1ac5be58df0e5ecd375d /src/cmd/gc/align.c
parent6f0382d8bbc2c333352d701afaaf94b916933fca (diff)
downloadgo-7b1e1f5210264d7a6fcfca501ad5d95c3c46471c.tar.gz
gc: five bug fixes, one better error.
* check for struct literal assignment to private fields. * record, fix crash involving parallel map assignment. * avoid infinite recursion in exportassignok. * make floating point bounds check precise. * avoid crash on invalid receiver. * add context to error about implicit assignment. Fixes issue 86. Fixes issue 88. Fixes issue 158. Fixes issue 174. Fixes issue 201. Fixes issue 204. R=ken2 http://codereview.appspot.com/154144
Diffstat (limited to 'src/cmd/gc/align.c')
-rw-r--r--src/cmd/gc/align.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cmd/gc/align.c b/src/cmd/gc/align.c
index ba43fa05b..d1cc9c23b 100644
--- a/src/cmd/gc/align.c
+++ b/src/cmd/gc/align.c
@@ -495,10 +495,11 @@ typeinit(void)
mpatofix(maxintval[TUINT32], "0xffffffff");
mpatofix(maxintval[TUINT64], "0xffffffffffffffff");
- mpatoflt(maxfltval[TFLOAT32], "3.40282347e+38");
- mpatoflt(minfltval[TFLOAT32], "-3.40282347e+38");
- mpatoflt(maxfltval[TFLOAT64], "1.7976931348623157e+308");
- mpatoflt(minfltval[TFLOAT64], "-1.7976931348623157e+308");
+ /* f is valid float if min < f < max. (min and max are not themselves valid.) */
+ mpatoflt(maxfltval[TFLOAT32], "33554431p103"); /* 2^24-1 p (127-23) + 1/2 ulp*/
+ mpatoflt(minfltval[TFLOAT32], "-33554431p103");
+ mpatoflt(maxfltval[TFLOAT64], "18014398509481983p970"); /* 2^53-1 p (1023-52) + 1/2 ulp */
+ mpatoflt(minfltval[TFLOAT64], "-18014398509481983p970");
/* for walk to use in error messages */
types[TFUNC] = functype(N, nil, nil);