1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Ensure that in all flex lexers that are part of the backend, a

yy_fatal_error() call results in elog(ERROR) not exit().  This was
already fixed in the main lexer and plpgsql, but extend same technique
to all the other dot-l files.  Also, on review of the possible calls
to yy_fatal_error(), it seems safe to use elog(ERROR) not elog(FATAL).
This commit is contained in:
Tom Lane
2003-05-29 22:30:02 +00:00
parent 4fb5b92769
commit 5666462f2e
7 changed files with 23 additions and 8 deletions

View File

@ -7,6 +7,9 @@
#include "buffer.h"
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
#define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
/* flex screws a couple symbols when used with the -P option; fix those */
#define YY_DECL int cube_yylex YY_PROTO(( void )); \
@ -52,6 +55,5 @@ float ({integer}|{real})([eE]{integer})?
int cube_yylex();
void cube_flush_scanner_buffer(void) {
fprintf(stderr, "cube_flush_scanner_buffer called\n");
YY_FLUSH_BUFFER;
}