summaryrefslogtreecommitdiffstats
path: root/external/dtoa/coverity.patch
blob: 8fb1765315af116ca7e8ea4bae727efc6b61bbcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- dtor/src/dtoa.c.coverity
+++ dtor/src/dtoa.c
@@ -216,14 +216,14 @@
 typedef unsigned Long ULong;
 #endif
 
-#ifdef DEBUG
 #include <assert.h>
+
+#ifdef DEBUG
 #include "stdio.h"
 #define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
 #define Debug(x) x
 int dtoa_stats[7]; /* strtod_{64,96,bigcomp},dtoa_{exact,64,96,bigcomp} */
 #else
-#define assert(x) /*nothing*/
 #define Debug(x) /*nothing*/
 #endif
 
@@ -2301,6 +2301,7 @@
 	if ((y = d1)) {
 		if ((k = lo0bits(&y))) {
 			x[0] = y | z << (32 - k);
+			assert(k < 32); /* https://bugs.python.org/issue23999 */
 			z >>= k;
 			}
 		else
@@ -3029,6 +3030,7 @@
 			 || ((n = nbits & kmask) !=0
 			     && hi0bits(x[k-1]) < 32-n)) {
 				rshift(b,1);
+			        /* coverity[dead_error_line] - not worth investigating */
 				if (++e > Emax)
 					goto ovfl;
 				}
@@ -3345,6 +3347,7 @@
 		if ((dd = s0[j++] - '0' - dig))
 			goto ret;
 		if (!b->x[0] && b->wds == 1) {
+			/* coverity[copy_paste_error : FALSE] */
 			if (i < nd)
 				dd = 1;
 			goto ret;
@@ -3607,6 +3610,7 @@
 		switch(c = *++s) {
 			case '-':
 				esign = 1;
+				/* fall through */
 			case '+':
 				c = *++s;
 			}