forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1a027e6
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 parent6599d8f commit1a027e6
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 | |
---|---|---|---|
| |||
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
312 |
| - | |
| 312 | + | |
313 | 313 |
| |
314 | 314 |
| |
315 | 315 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1520 | 1520 |
| |
1521 | 1521 |
| |
1522 | 1522 |
| |
1523 |
| - | |
1524 |
| - | |
| 1523 | + | |
| 1524 | + | |
1525 | 1525 |
| |
1526 | 1526 |
| |
1527 | 1527 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
296 | 296 |
| |
297 | 297 |
| |
298 | 298 |
| |
299 |
| - | |
300 |
| - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
301 | 302 |
| |
302 | 303 |
| |
303 | 304 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5282 | 5282 |
| |
5283 | 5283 |
| |
5284 | 5284 |
| |
5285 |
| - | |
5286 |
| - | |
| 5285 | + | |
| 5286 | + | |
| 5287 | + | |
5287 | 5288 |
| |
5288 | 5289 |
| |
5289 | 5290 |
| |
|
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 |
| |
| |||
875 | 875 |
| |
876 | 876 |
| |
877 | 877 |
| |
878 |
| - | |
879 |
| - | |
880 |
| - | |
881 |
| - | |
882 |
| - | |
883 |
| - | |
884 |
| - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
885 | 882 |
| |
886 | 883 |
| |
887 | 884 |
| |
| |||
1016 | 1013 |
| |
1017 | 1014 |
| |
1018 | 1015 |
| |
1019 |
| - | |
1020 |
| - | |
1021 |
| - | |
1022 |
| - | |
1023 |
| - | |
1024 |
| - | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1025 | 1019 |
| |
1026 | 1020 |
| |
1027 | 1021 |
| |
| |||
1043 | 1037 |
| |
1044 | 1038 |
| |
1045 | 1039 |
| |
1046 |
| - | |
1047 |
| - | |
1048 |
| - | |
1049 |
| - | |
1050 |
| - | |
1051 |
| - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1052 | 1043 |
| |
1053 |
| - | |
1054 |
| - | |
1055 |
| - | |
1056 |
| - | |
1057 |
| - | |
1058 |
| - | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1059 | 1047 |
| |
1060 | 1048 |
| |
1061 | 1049 |
| |
|
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 | |
---|---|---|---|
| |||
8886 | 8886 |
| |
8887 | 8887 |
| |
8888 | 8888 |
| |
| 8889 | + | |
| 8890 | + | |
| 8891 | + | |
| 8892 | + | |
8889 | 8893 |
| |
8890 | 8894 |
| |
8891 | 8895 |
| |
8892 | 8896 |
| |
8893 | 8897 |
| |
8894 | 8898 |
| |
| 8899 | + | |
| 8900 | + | |
| 8901 | + | |
| 8902 | + | |
8895 | 8903 |
| |
8896 | 8904 |
| |
8897 | 8905 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
594 | 594 |
| |
595 | 595 |
| |
596 | 596 |
| |
597 |
| - | |
598 |
| - | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
599 | 600 |
| |
600 | 601 |
| |
601 |
| - | |
602 |
| - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
603 | 605 |
| |
604 | 606 |
| |
605 | 607 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
910 | 910 |
| |
911 | 911 |
| |
912 | 912 |
| |
913 |
| - | |
| 913 | + | |
| 914 | + | |
914 | 915 |
| |
915 | 916 |
| |
916 | 917 |
| |
|
0 commit comments
Comments
(0)