Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f43446

Browse files
committed
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 pallocand pfree for allocations within the lexer; when you do that, theyy_buffer_stack gets freed at inopportune times. The code is alreadyset up to do manual deallocation, so I see no particular advantage tousing palloc anyway.
1 parent0441e26 commit3f43446

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

‎contrib/tsearch/parser.l

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error)*/
88
#definefprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
99

10-
/* postgres allocation function*/
11-
#definefree pfree
12-
#definemalloc palloc
13-
#definerealloc repalloc
14-
15-
#ifdef strdup
16-
#undef strdup
17-
#endif
18-
#definestrdup pstrdup
19-
2010
char *token =NULL;/* pointer to token*/
2111
char *s =NULL;/* to return WHOLE hyphenated-word*/
2212

‎contrib/tsearch2/wordparser/parser.l

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@
88
/* Avoid exit() on fatal scanner errors*/
99
#definefprintf(file, fmt, msg) ts_error(ERROR, fmt, msg)
1010

11-
/* postgres allocation function*/
12-
#definefree pfree
13-
#definemalloc palloc
14-
#definerealloc repalloc
15-
16-
#ifdef strdup
17-
#undef strdup
18-
#endif
19-
#definestrdup pstrdup
20-
2111
char *token =NULL;/* pointer to token*/
2212
char *s =NULL;/* to return WHOLE hyphenated-word*/
2313

@@ -303,6 +293,3 @@ void start_parse_str(char* str, int limit) {
303293
tsearch2_yy_switch_to_buffer( buf );
304294
BEGIN INITIAL;
305295
}
306-
307-
308-

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp