Skip to content

Commit

Permalink
genksyms: fix gperf removal conversion
Browse files Browse the repository at this point in the history
I had stupidly missed one special use of 'is_reserved_word()' when I
converted the code to avoid gperf.

I had changed that function to return the token ID directly rather than
a pointer to the token descriptor structure, but that meant that the
test for "is this a reserved word" changed from checking the return
value against NULL, to checking that it wasn't negative.

And while I had converted the main token parser over, I missed the
special case of the typeof phrase handling.  And since our dependency
chain for genksyms does not include the genksyms program itself
changing, my kernel rebuild didn't show the problem.

Fixes: bb3290d ("Remove gperf usage from toolchain")
Reported-by: Masahiro Yamada <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Sep 8, 2017
1 parent 015a9e6 commit 3aea311
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/genksyms/lex.l
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ repeat:
case ST_TYPEOF_1:
if (token == IDENT)
{
if (is_reserved_word(yytext, yyleng)
if (is_reserved_word(yytext, yyleng) >= 0
|| find_symbol(yytext, SYM_TYPEDEF, 1))
{
yyless(0);
Expand Down
2 changes: 1 addition & 1 deletion scripts/genksyms/lex.lex.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ repeat:
case ST_TYPEOF_1:
if (token == IDENT)
{
if (is_reserved_word(yytext, yyleng)
if (is_reserved_word(yytext, yyleng) >= 0
|| find_symbol(yytext, SYM_TYPEDEF, 1))
{
yyless(0);
Expand Down

0 comments on commit 3aea311

Please sign in to comment.