- Notifications
You must be signed in to change notification settings - Fork5k
Commit46ab07f
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 parent62ce0c7 commit46ab07f
9 files changed
+31
-15
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
198 | 198 |
| |
199 | 199 |
| |
200 | 200 |
| |
201 |
| - | |
| 201 | + | |
202 | 202 |
| |
203 | 203 |
| |
204 | 204 |
| |
|
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 | |
---|---|---|---|
| |||
5353 | 5353 |
| |
5354 | 5354 |
| |
5355 | 5355 |
| |
5356 |
| - | |
5357 |
| - | |
| 5356 | + | |
| 5357 | + | |
| 5358 | + | |
5358 | 5359 |
| |
5359 | 5360 |
| |
5360 | 5361 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
773 | 773 |
| |
774 | 774 |
| |
775 | 775 |
| |
776 |
| - | |
777 |
| - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
778 | 781 |
| |
779 | 782 |
| |
780 | 783 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10048 | 10048 |
| |
10049 | 10049 |
| |
10050 | 10050 |
| |
| 10051 | + | |
| 10052 | + | |
| 10053 | + | |
| 10054 | + | |
10051 | 10055 |
| |
10052 | 10056 |
| |
10053 | 10057 |
| |
10054 | 10058 |
| |
10055 | 10059 |
| |
10056 | 10060 |
| |
| 10061 | + | |
| 10062 | + | |
| 10063 | + | |
| 10064 | + | |
10057 | 10065 |
| |
10058 | 10066 |
| |
10059 | 10067 |
| |
|
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 | |
---|---|---|---|
| |||
966 | 966 |
| |
967 | 967 |
| |
968 | 968 |
| |
969 |
| - | |
| 969 | + | |
| 970 | + | |
970 | 971 |
| |
971 | 972 |
| |
972 | 973 |
| |
|
0 commit comments
Comments
(0)