| От | Tom Lane |
|---|---|
| Тема | Re: [HACKERS] safer node casting |
| Дата | |
| Msg-id | 6303.1487951669@sss.pgh.pa.us обсуждение |
| Ответ на | Re: [HACKERS] safer node casting (Andres Freund <andres@anarazel.de>) |
| Ответы |
Re: [HACKERS] safer node casting
|
| Список | pgsql-hackers |
Andres Freund <andres@anarazel.de> writes:
> Those aren't actually equivalent, because of the !nodeptr. IsA() crashes
> for NULL pointers, but the new code won't. Which means 9ba8a9ce4548b et
> al actually weakened some asserts.
> Should we perhaps have one NULL accepting version (castNodeNull?) and
> one that separately asserts that ptr != NULL?
-1 ... if you're going to use something in a way that requires it not tobe null, your code will crash quite efficiently
ona null, with orwithout an assert. I don't think we need the extra cogitive burden oftwo distinct macros for this.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера