Teodor Sigaev <teodor@sigaev.ru> writes:
>> AFAICT tsearch2's incompatibility is in the redefined YY_INPUT macro,
>> which seems of no value for Postgres anyway. Can't we take that out?
> I resolve problem with gm4 with a help of symlink and reorder my PATH. So, it
> compiles but creates core dump while regression (postgres is compiled with
> enable-debug and enable-cassert):
I found the cause -- you had #defined malloc as palloc, etc. That
caused the yy_buffer_stack to get deallocated between calls to the
lexer, which flex isn't expecting. Since you have code to clean up
the lexer state, I don't see any need to use palloc here.
regards, tom lane