diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-09-14 18:44:23 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-09-14 18:44:23 +0000 |
commit | 3f43446e36bdc6a20784351185c27aabdad456eb (patch) | |
tree | a721f8085ad6a4af92dc74f18a539fa333c75c89 | |
parent | 0441e269eab927507b95c7f30a77435471553562 (diff) | |
download | postgresql-3f43446e36bdc6a20784351185c27aabdad456eb.tar.gz postgresql-3f43446e36bdc6a20784351185c27aabdad456eb.zip |
Persuade tsearch/tsearch2 to work (or at least pass their regression
tests) when using flex 2.5.31. The fix is to *not* try to use palloc
and pfree for allocations within the lexer; when you do that, the
yy_buffer_stack gets freed at inopportune times. The code is already
set up to do manual deallocation, so I see no particular advantage to
using palloc anyway.
-rw-r--r-- | contrib/tsearch/parser.l | 10 | ||||
-rw-r--r-- | contrib/tsearch2/wordparser/parser.l | 13 |
2 files changed, 0 insertions, 23 deletions
diff --git a/contrib/tsearch/parser.l b/contrib/tsearch/parser.l index 2bf3dcba076..17ac21dcd1c 100644 --- a/contrib/tsearch/parser.l +++ b/contrib/tsearch/parser.l @@ -7,16 +7,6 @@ /* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */ #define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg))) -/* postgres allocation function */ -#define free pfree -#define malloc palloc -#define realloc repalloc - -#ifdef strdup -#undef strdup -#endif -#define strdup pstrdup - char *token = NULL; /* pointer to token */ char *s = NULL; /* to return WHOLE hyphenated-word */ diff --git a/contrib/tsearch2/wordparser/parser.l b/contrib/tsearch2/wordparser/parser.l index 23cfedaa201..b7f5a0013b6 100644 --- a/contrib/tsearch2/wordparser/parser.l +++ b/contrib/tsearch2/wordparser/parser.l @@ -8,16 +8,6 @@ /* Avoid exit() on fatal scanner errors */ #define fprintf(file, fmt, msg) ts_error(ERROR, fmt, msg) -/* postgres allocation function */ -#define free pfree -#define malloc palloc -#define realloc repalloc - -#ifdef strdup -#undef strdup -#endif -#define strdup pstrdup - char *token = NULL; /* pointer to token */ char *s = NULL; /* to return WHOLE hyphenated-word */ @@ -303,6 +293,3 @@ void start_parse_str(char* str, int limit) { tsearch2_yy_switch_to_buffer( buf ); BEGIN INITIAL; } - - - |