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

Commitaa9eac4

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 parentf41042c commitaa9eac4

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
@@ -39,12 +39,12 @@ TestSpecparseresult;/* result of parsing is left here */
3939
%type<str>opt_setupopt_teardown
4040
%type<str>setup
4141
%type<ptr_list>step_listsession_listpermutation_listopt_permutation_list
42-
%type<ptr_list>string_list
42+
%type<ptr_list>string_literal_list
4343
%type<session>session
4444
%type<step>step
4545
%type<permutation>permutation
4646

47-
%token<str>sqlblockstring
47+
%token<str>sqlblockstring_literal
4848
%tokenPERMUTATIONSESSIONSETUPSTEPTEARDOWNTEST
4949

5050
%%
@@ -111,7 +111,7 @@ session_list:
111111
;
112112

113113
session:
114-
SESSIONstringopt_setupstep_listopt_teardown
114+
SESSIONstring_literalopt_setupstep_listopt_teardown
115115
{
116116
$$ = malloc(sizeof(Session));
117117
$$->name =$2;
@@ -140,7 +140,7 @@ step_list:
140140

141141

142142
step:
143-
STEPstringsqlblock
143+
STEPstring_literalsqlblock
144144
{
145145
$$ = malloc(sizeof(Step));
146146
$$->name =$2;
@@ -179,23 +179,23 @@ permutation_list:
179179

180180

181181
permutation:
182-
PERMUTATIONstring_list
182+
PERMUTATIONstring_literal_list
183183
{
184184
$$ = malloc(sizeof(Permutation));
185185
$$->stepnames = (char **)$2.elements;
186186
$$->nsteps =$2.nelements;
187187
}
188188
;
189189

190-
string_list:
191-
string_liststring
190+
string_literal_list:
191+
string_literal_liststring_literal
192192
{
193193
$$.elements = realloc($1.elements,
194194
($1.nelements +1) *sizeof(void *));
195195
$$.elements[$1.nelements] =$2;
196196
$$.nelements =$1.nelements +1;
197197
}
198-
|string
198+
|string_literal
199199
{
200200
$$.nelements =1;
201201
$$.elements = malloc(sizeof(void *));

‎src/test/isolation/specscanner.l

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp