[LLVMbugs] [Bug 13279] New: Assertion triggered in clang::Expr::ClassifyImpl

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 5 13:12:37 PDT 2012


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

             Bug #: 13279
           Summary: Assertion triggered in clang::Expr::ClassifyImpl
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chrisn303 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Using clang version 3.2 (trunk 159724), an assertion fails on the following
code:

$ cat test.c
#ifndef FALSE
#   define FALSE 0
#endif

typedef bool_t (*P)(int v);

typedef struct
{
    uint32_t n;
    bool_t b;
} A;

static A a;

void foo(void)
{
    a.b = FALSE;
}


$ clang test.c
test.c:5:18: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
typedef bool_t (*P)(int v);
                ~^
test.c:5:9: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
typedef bool_t (*P)(int v);
~~~~~~~ ^
test.c:5:16: error: function cannot return function type 'int (int)'
typedef bool_t (*P)(int v);
               ^
test.c:9:5: error: unknown type name 'uint32_t'
    uint32_t n;
    ^
clang: /home/chris/llvm/llvm/tools/clang/lib/AST/ExprClassification.cpp:82: Cl
clang::Expr::ClassifyImpl(clang::ASTContext &, clang::SourceLocation *) const:
Assertion `getValueKind() == VK_RValue' failed.
0  clang     0x0b177f78
1  clang     0x0b178627
2            0xb777f400 __kernel_sigreturn + 0
3  clang     0x09ad2234
4  clang     0x09ad13ca clang::Expr::isModifiableLvalue(clang::ASTContext&,
clang::SourceLocation*) const + 138
5  clang     0x08ceba57
6  clang     0x08ceb021 clang::Sema::CheckAssignmentOperands(clang::Expr*,
clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation,
clang::QualType) + 241
7  clang     0x08ced48c clang::Sema::CreateBuiltinBinOp(clang::SourceLocation,
clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) + 972
8  clang     0x08cf06d8 clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) +
2088
9  clang     0x08cbed9b clang::Sema::ActOnBinOp(clang::Scope*,
clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 347
10 clang     0x08a4ba82
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level) + 5170
11 clang     0x08a4a63b
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 395
12 clang     0x08a4a467
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 71
13 clang     0x08a8af32 clang::Parser::ParseExprStatement() + 114
14 clang     0x08a8a48f
clang::Parser::ParseStatementOrDeclarationAfterAttributes(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 3823
15 clang     0x08a8942d
clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 221
16 clang     0x08a936eb clang::Parser::ParseCompoundStatementBody(bool) + 2139
17 clang     0x08a9601b clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 395
18 clang     0x08a008df
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&,
llvm::SmallVector<clang::Parser::LateParsedAttribute*, 2u>*) + 4847
19 clang     0x08a1aeac clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 700
20 clang     0x089ff5da
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 1770
21 clang     0x089fe9b2
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 258
22 clang     0x089fdda9
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 4537
23 clang     0x089fcba2
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 610
24 clang     0x089f80a6 clang::ParseAST(clang::Sema&, bool, bool) + 710
25 clang     0x084d7155 clang::ASTFrontendAction::ExecuteAction() + 373
26 clang     0x08758e3f clang::CodeGenAction::ExecuteAction() + 1743
27 clang     0x084d6c44 clang::FrontendAction::Execute() + 308
28 clang     0x0849bfae
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1038
29 clang     0x08452289
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1177
30 clang     0x08435dcc cc1_main(char const**, char const**, char const*,
void*) + 1452
31 clang     0x0844a39b main + 715
32 libc.so.6 0x444a1635 __libc_start_main + 245
Stack dump:
0.    Program arguments: /usr/local/bin/clang -cc1 -triple i386-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name test.c -mrelocation-model
static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-fuse-init-array -target-cpu pentium4 -target-linker-version 2.22.52.0.1
-momit-leaf-frame-pointer -resource-dir /usr/local/bin/../lib/clang/3.2
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/local/include -internal-isystem /usr/local/bin/../lib/clang/3.2/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /home/chris/clangtest -ferror-limit 19 -fmessage-length
90 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/test-Y1C7fk.o -x c test.c 
1.    test.c:17:16: current parser token ';'
2.    test.c:16:1: parsing function body 'foo'
3.    test.c:16:1: in compound statement ('{}')
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.2 (trunk 159724) (llvm/trunk 159723:159724)
Target: i386-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.

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