[LLVMbugs] [Bug 14369] New: crash when lexing a file ending in '\<eof>

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Nov 17 10:00:42 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=14369

             Bug #: 14369
           Summary: crash when lexing a file ending in '\<eof>
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9559
  --> http://llvm.org/bugs/attachment.cgi?id=9559
repro

Nicos-MacBook-Pro:gong thakis$ cat test.c
// RUN: %gong_cc1 %s -verify -fsyntax-only
// vim: set binary noeol

char c = '\Nicos-MacBook-Pro:gong thakis$ ../../Release+Asserts/bin/clang -c
test.c
test.c:4:10: warning: missing terminating ' character [-Winvalid-pp-token]
char c = '\
         ^
test.c:4:10: error: expected expression
Assertion failed: (Loc >= BufferStart && Loc <= BufferEnd && "Location out of
range for this buffer!"), function getSourceLocation, file Lexer.cpp, line
1170.
0  clang             0x000000010531fb82 PrintStackTrace(void*) + 34
1  clang             0x00000001053200a9 SignalHandler(int) + 713
2  libsystem_c.dylib 0x00007fff8b7f58ea _sigtramp + 26
3  clang             0x00000001053453de
llvm::_system_error_category::~_system_error_category() + 32254
4  clang             0x000000010531fdc6 abort + 22
5  clang             0x000000010531fd85 __assert_rtn + 53
6  clang             0x000000010472d7c1 clang::Lexer::getSourceLocation(char
const*, unsigned int) const + 97
7  clang             0x000000010473197f
clang::Lexer::LexTokenInternal(clang::Token&) + 783
8  clang             0x0000000103f832c7
clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, bool, bool,
bool) + 663
9  clang             0x0000000103f26bb7
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&) + 1639
10 clang             0x0000000103f25607
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 2039
11 clang             0x0000000103f8673c
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 908
12 clang             0x0000000103f8606f
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 239
13 clang             0x0000000103f856d7
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2903
14 clang             0x0000000103f84af7
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 311
15 clang             0x0000000103f182f4 clang::ParseAST(clang::Sema&, bool,
bool) + 276
16 clang             0x0000000103edd1e2 clang::CodeGenAction::ExecuteAction() +
1298
17 clang             0x0000000103cddd1d clang::FrontendAction::Execute() + 109
18 clang             0x0000000103cc0ccf
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1007
19 clang             0x0000000103c89c01
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3569
20 clang             0x0000000103c81868 cc1_main(char const**, char const**,
char const*, void*) + 872
21 clang             0x0000000103c85b24 main + 708
22 libdyld.dylib     0x00007fff8de2e7e1 start + 0

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list