pgsql: Fix recently-exposed portability issue in regex optimization.

2024-11-17 Thread Tom Lane
Fix recently-exposed portability issue in regex optimization. fixempties() counts the number of in-arcs in the regex NFA and then allocates an array of that many arc pointers. If the NFA contains no arcs, this amounts to malloc(0) for which some platforms return NULL. The code mistakenly treats t

pgsql: Fix recently-exposed portability issue in regex optimization.

2024-11-17 Thread Tom Lane
Fix recently-exposed portability issue in regex optimization. fixempties() counts the number of in-arcs in the regex NFA and then allocates an array of that many arc pointers. If the NFA contains no arcs, this amounts to malloc(0) for which some platforms return NULL. The code mistakenly treats t

pgsql: Fix recently-exposed portability issue in regex optimization.

2024-11-17 Thread Tom Lane
Fix recently-exposed portability issue in regex optimization. fixempties() counts the number of in-arcs in the regex NFA and then allocates an array of that many arc pointers. If the NFA contains no arcs, this amounts to malloc(0) for which some platforms return NULL. The code mistakenly treats t