forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb0bc196
committed
Clean up assorted failures under clang's -fsanitize=undefined checks.
Most of these are cases where we could call memcpy() or other libcfunctions with a NULL pointer and a zero count, which is forbiddenby POSIX even though every production version of libc allows it.We've fixed such things before in a piecemeal way, but apparentlynever made an effort to try to get them all. I don't claim thatthis patch does so either, but it gets every failure I observe incheck-world, using clang 12.0.1 on current RHEL8.numeric.c has a different issue that the sanitizer doesn't like:"ln(-1.0)" will compute log10(0) and then try to assign theresulting -Inf to an integer variable. We don't actually use theresult in such a case, so there's no live bug.Back-patch to all supported branches, with the idea that we mightstart running a buildfarm member that tests this case. This includesback-patchingc1132aa (Check the size in COPY_POINTER_FIELD),which previously silenced some of these issues in copyfuncs.c.Discussion:https://postgr.es/m/CALNJ-vT9r0DSsAOw9OXVJFxLENoVS_68kJ5x0p44atoYH+H4dg@mail.gmail.com1 parent2a1f846 commitb0bc196
File tree
10 files changed
+52
-48
lines changed- contrib/pgcrypto
- src
- backend
- access
- heap
- transam
- nodes
- storage/ipc
- utils
- adt
- time
- fe_utils
10 files changed
+52
-48
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
203 |
| - | |
| 203 | + | |
204 | 204 |
| |
205 | 205 |
| |
206 | 206 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
331 |
| - | |
| 331 | + | |
332 | 332 |
| |
333 | 333 |
| |
334 | 334 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1564 | 1564 |
| |
1565 | 1565 |
| |
1566 | 1566 |
| |
1567 |
| - | |
1568 |
| - | |
| 1567 | + | |
| 1568 | + | |
1569 | 1569 |
| |
1570 | 1570 |
| |
1571 | 1571 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
297 | 297 |
| |
298 | 298 |
| |
299 | 299 |
| |
300 |
| - | |
301 |
| - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
302 | 303 |
| |
303 | 304 |
| |
304 | 305 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5305 | 5305 |
| |
5306 | 5306 |
| |
5307 | 5307 |
| |
5308 |
| - | |
5309 |
| - | |
| 5308 | + | |
| 5309 | + | |
| 5310 | + | |
5310 | 5311 |
| |
5311 | 5312 |
| |
5312 | 5313 |
| |
|
Lines changed: 21 additions & 33 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
61 |
| - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
62 | 65 |
| |
63 | 66 |
| |
64 | 67 |
| |
| |||
296 | 299 |
| |
297 | 300 |
| |
298 | 301 |
| |
299 |
| - | |
300 |
| - | |
301 |
| - | |
302 |
| - | |
303 |
| - | |
304 |
| - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
305 | 305 |
| |
306 | 306 |
| |
307 | 307 |
| |
| |||
897 | 897 |
| |
898 | 898 |
| |
899 | 899 |
| |
900 |
| - | |
901 |
| - | |
902 |
| - | |
903 |
| - | |
904 |
| - | |
905 |
| - | |
906 |
| - | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
907 | 904 |
| |
908 | 905 |
| |
909 | 906 |
| |
| |||
1067 | 1064 |
| |
1068 | 1065 |
| |
1069 | 1066 |
| |
1070 |
| - | |
1071 |
| - | |
1072 |
| - | |
1073 |
| - | |
1074 |
| - | |
1075 |
| - | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1076 | 1070 |
| |
1077 | 1071 |
| |
1078 | 1072 |
| |
| |||
1094 | 1088 |
| |
1095 | 1089 |
| |
1096 | 1090 |
| |
1097 |
| - | |
1098 |
| - | |
1099 |
| - | |
1100 |
| - | |
1101 |
| - | |
1102 |
| - | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1103 | 1094 |
| |
1104 |
| - | |
1105 |
| - | |
1106 |
| - | |
1107 |
| - | |
1108 |
| - | |
1109 |
| - | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
1110 | 1098 |
| |
1111 | 1099 |
| |
1112 | 1100 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
748 | 748 |
| |
749 | 749 |
| |
750 | 750 |
| |
751 |
| - | |
752 |
| - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
753 | 756 |
| |
754 | 757 |
| |
755 | 758 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9868 | 9868 |
| |
9869 | 9869 |
| |
9870 | 9870 |
| |
| 9871 | + | |
| 9872 | + | |
| 9873 | + | |
| 9874 | + | |
9871 | 9875 |
| |
9872 | 9876 |
| |
9873 | 9877 |
| |
9874 | 9878 |
| |
9875 | 9879 |
| |
9876 | 9880 |
| |
| 9881 | + | |
| 9882 | + | |
| 9883 | + | |
| 9884 | + | |
9877 | 9885 |
| |
9878 | 9886 |
| |
9879 | 9887 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
536 | 536 |
| |
537 | 537 |
| |
538 | 538 |
| |
539 |
| - | |
540 |
| - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
541 | 542 |
| |
542 | 543 |
| |
543 |
| - | |
544 |
| - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
545 | 547 |
| |
546 | 548 |
| |
547 | 549 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
896 | 896 |
| |
897 | 897 |
| |
898 | 898 |
| |
899 |
| - | |
| 899 | + | |
| 900 | + | |
900 | 901 |
| |
901 | 902 |
| |
902 | 903 |
| |
|
0 commit comments
Comments
(0)