Re: longjmp clobber warnings are utterly broken in modern gcc
От | Tom Lane |
---|---|
Тема | Re: longjmp clobber warnings are utterly broken in modern gcc |
Дата | |
Msg-id | 22998.1422231072@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: longjmp clobber warnings are utterly broken in modern gcc (Martijn van Oosterhout <kleptog@svana.org>) |
Ответы |
Re: longjmp clobber warnings are utterly broken in
modern gcc
|
Список | pgsql-hackers |
Martijn van Oosterhout <kleptog@svana.org> writes: > On Sun, Jan 25, 2015 at 02:02:47PM -0500, Tom Lane wrote: >> This is scary as hell. I intend to go around and manually audit >> every single PG_TRY in the current source code, but that is obviously >> not a long-term solution. Anybody have an idea about how we might >> get trustworthy mechanical detection of this type of situation? > It's a bit of a long shot, but perhaps if you put something like: > asm volatile("":"":"":"memory") > at the beginning of the catch-block it might convince the compiler to > forget any assumptions about what is in the local variables... Meh. Even if that worked for gcc (which as you say is uncertain), it would help not at all for other compilers. The POSIX requirements for portable code are clear: we need a "volatile" marker on affected variables. regards, tom lane
В списке pgsql-hackers по дате отправления: