diff options
| author | Nicholas Piggin <npiggin@gmail.com> | 2016-08-25 05:53:08 -0400 |
|---|---|---|
| committer | Michal Marek <mmarek@suse.com> | 2016-08-25 12:55:37 -0400 |
| commit | 4fab91605a6bcd0c303bcbc292a8bffcf27b3a27 (patch) | |
| tree | 9a25f7df6103854aa4b78a0ec07a3760fa374734 /scripts | |
| parent | dee81e9886748594babac67c14b0f720148e255d (diff) | |
kbuild: genksyms fix for typeof handling
The tokenizer misses counting an open-parenthesis when parsing a
non-trivial typeof beginning with an open-parenthesis. This function
in include/linux/ceph/libceph.h
static type *lookup_##name(struct rb_root *root,
typeof(((type *)0)->keyfld) key)
When instantiated in net/ceph/mon_client.c, causes subsequent symbols
including an EXPORT_SYMBOL in that file to be lost.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/genksyms/lex.l | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l index e583565f2011..5235aa507ba5 100644 --- a/scripts/genksyms/lex.l +++ b/scripts/genksyms/lex.l | |||
| @@ -289,6 +289,23 @@ repeat: | |||
| 289 | } | 289 | } |
| 290 | break; | 290 | break; |
| 291 | 291 | ||
| 292 | case ST_TYPEOF_1: | ||
| 293 | if (token == IDENT) | ||
| 294 | { | ||
| 295 | if (is_reserved_word(yytext, yyleng) | ||
| 296 | || find_symbol(yytext, SYM_TYPEDEF, 1)) | ||
| 297 | { | ||
| 298 | yyless(0); | ||
| 299 | unput('('); | ||
| 300 | lexstate = ST_NORMAL; | ||
| 301 | token = TYPEOF_KEYW; | ||
| 302 | break; | ||
| 303 | } | ||
| 304 | _APP("(", 1); | ||
| 305 | } | ||
| 306 | lexstate = ST_TYPEOF; | ||
| 307 | /* FALLTHRU */ | ||
| 308 | |||
| 292 | case ST_TYPEOF: | 309 | case ST_TYPEOF: |
| 293 | switch (token) | 310 | switch (token) |
| 294 | { | 311 | { |
| @@ -313,24 +330,6 @@ repeat: | |||
| 313 | } | 330 | } |
| 314 | break; | 331 | break; |
| 315 | 332 | ||
| 316 | case ST_TYPEOF_1: | ||
| 317 | if (token == IDENT) | ||
| 318 | { | ||
| 319 | if (is_reserved_word(yytext, yyleng) | ||
| 320 | || find_symbol(yytext, SYM_TYPEDEF, 1)) | ||
| 321 | { | ||
| 322 | yyless(0); | ||
| 323 | unput('('); | ||
| 324 | lexstate = ST_NORMAL; | ||
| 325 | token = TYPEOF_KEYW; | ||
| 326 | break; | ||
| 327 | } | ||
| 328 | _APP("(", 1); | ||
| 329 | } | ||
| 330 | APP; | ||
| 331 | lexstate = ST_TYPEOF; | ||
| 332 | goto repeat; | ||
| 333 | |||
| 334 | case ST_BRACKET: | 333 | case ST_BRACKET: |
| 335 | APP; | 334 | APP; |
| 336 | switch (token) | 335 | switch (token) |
