LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 21846 - [fuzz] Assertion `!isAnnotation() && "getIdentifierInfo() on an annotation token!"' failed.
Summary: [fuzz] Assertion `!isAnnotation() && "getIdentifierInfo() on an annotation to...
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: -New Bugs (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks: 23057
  Show dependency tree
 
Reported: 2014-12-10 15:46 PST by Sami Liedes
Modified: 2015-04-27 20:29 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments
test case (56 bytes, text/x-c++src)
2014-12-10 15:46 PST, Sami Liedes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sami Liedes 2014-12-10 15:46:47 PST
Created attachment 13487 [details]
test case

Fuzzing discovered that the attached test case, when given as input to

  clang -fno-crash-diagnostics -std=c++11 -xc++ -c -emit-llvm

causes this assertion failure:

clang-3.6: tools/clang/include/clang/Lex/Token.h:163: clang::IdentifierInfo *clang::Token::getIdentifierInfo() const: Assertion `!isAnnotation() && "getIdentifierInfo() on an annotation token!"' failed.
Comment 1 Davide Italiano 2015-04-27 20:29:57 PDT
Fixed in clang head.

% ./clang -fno-crash-diagnostics -std=c++11 -xc++ -c -emit-llvm lex_crash.cpp
lex_crash.cpp:2:15: error: declaration of anonymous struct must be a definition
struct A::X < struct T
              ^
lex_crash.cpp:3:1: error: expected a type
^
lex_crash.cpp:2:11: error: explicit specialization of non-template struct 'X'
struct A::X < struct T
          ^
lex_crash.cpp:2:11: error: no struct named 'X' in 'A<T>'
struct A::X < struct T
       ~~~^
lex_crash.cpp:3:1: error: expected member name or ';' after declaration specifiers
^
lex_crash.cpp:3:1: error: expected '}'
lex_crash.cpp:1:32: note: to match this '{'
template <typename T> struct A {
                               ^
lex_crash.cpp:2:23: error: expected ';' after struct
struct A::X < struct T
                      ^
                      ;
7 errors generated.