Add an Assert that enum_cmp_internal() gets passed an FmgrInfo pointer.
Tom Lane <tgl@sss.pgh.pa.us>
Add an Assert that enum_cmp_internal() gets passed an FmgrInfo pointer. If someone were to try to call one of the enum comparison functions using DirectFunctionCallN, it would very likely seem to work, because only in unusual cases does enum_cmp_internal() need to access the typcache. But once such a case occurred, code like that would crash with a null pointer dereference. To make an oversight of that sort less likely to escape detection, add a non-bypassable Assert that fcinfo->flinfo isn't NULL. Discussion: https://postgr.es/m/25226.1487900067@sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/enum.c | modified | +10 −6 |
Discussion
- btree_gin and btree_gist for enums 39 messages · 2016-03-17 → 2017-03-21