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

Commitee8b93c

Browse files
committed
Fix portability issue in isolationtester grammar.
specparse.y and specscanner.l used "string" as a token name. Now, bisonlikes to define each token name as a macro for the token code it assigns,which means those names are basically off-limits for any other use withinthe grammar file or included headers. So names as generic as "string" aredangerous. This is what was causing the recent failures on protosciurus:some versions of Solaris' sys/kstat.h use "string" as a field name.With late-model bison we don't see this problem because the token macrosaren't defined till later (that is why castoroides didn't show the problemeven though it's on the same machine). But protosciurus uses bison 1.875which defines the token macros up front.This land mine has been there from day one; we'd have found it soonerexcept that protosciurus wasn't trying to run the isolation tests tillrecently.To fix, rename the token to "string_literal" which is hopefully lesslikely to collide with names used by system headers. Back-patch toall branches containing the isolation tests.
1 parent5585cc7 commitee8b93c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

‎src/test/isolation/specparse.y

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ TestSpecparseresult;/* result of parsing is left here */
3737

3838
%type<str>opt_setupopt_teardown
3939
%type<ptr_list>step_listsession_listpermutation_listopt_permutation_list
40-
%type<ptr_list>string_list
40+
%type<ptr_list>string_literal_list
4141
%type<session>session
4242
%type<step>step
4343
%type<permutation>permutation
4444

45-
%token<str>sqlblockstring
45+
%token<str>sqlblockstring_literal
4646
%tokenPERMUTATIONSESSIONSETUPSTEPTEARDOWNTEST
4747

4848
%%
@@ -89,7 +89,7 @@ session_list:
8989
;
9090

9191
session:
92-
SESSIONstringopt_setupstep_listopt_teardown
92+
SESSIONstring_literalopt_setupstep_listopt_teardown
9393
{
9494
$$ = malloc(sizeof(Session));
9595
$$->name =$2;
@@ -118,7 +118,7 @@ step_list:
118118

119119

120120
step:
121-
STEPstringsqlblock
121+
STEPstring_literalsqlblock
122122
{
123123
$$ = malloc(sizeof(Step));
124124
$$->name =$2;
@@ -156,23 +156,23 @@ permutation_list:
156156

157157

158158
permutation:
159-
PERMUTATIONstring_list
159+
PERMUTATIONstring_literal_list
160160
{
161161
$$ = malloc(sizeof(Permutation));
162162
$$->stepnames = (char **)$2.elements;
163163
$$->nsteps =$2.nelements;
164164
}
165165
;
166166

167-
string_list:
168-
string_liststring
167+
string_literal_list:
168+
string_literal_liststring_literal
169169
{
170170
$$.elements = realloc($1.elements,
171171
($1.nelements +1) *sizeof(void *));
172172
$$.elements[$1.nelements] =$2;
173173
$$.nelements =$1.nelements +1;
174174
}
175-
|string
175+
|string_literal
176176
{
177177
$$.nelements =1;
178178
$$.elements = malloc(sizeof(void *));

‎src/test/isolation/specscanner.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ teardown{ return(TEARDOWN); }
5757
litbuf[litbufpos] ='\0';
5858
yylval.str =strdup(litbuf);
5959
BEGIN(INITIAL);
60-
return(string);
60+
return(string_literal);
6161
}
6262
<qstr>.{addlitchar(yytext[0]); }
6363
<qstr>\n{yyerror("unexpected newline in quoted string"); }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp