[LLVMbugs] [Bug 3396] New: Crash in Sema with non-constant offsetof

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Jan 24 14:36:20 PST 2009


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

           Summary: Crash in Sema with non-constant offsetof
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu


Testcase:

struct sockaddr_un {
 unsigned char sun_len;
 char sun_path[104];
};
int a() {
int a[__builtin_offsetof(struct sockaddr_un, sun_path[len+1])];
}

Crashes with the following message:
clang:
/home/eli/llvm/tools/clang/lib/CodeGen/../../include/clang/AST/Expr.h:169:
llvm::APSInt clang::Expr::getIntegerConstantExprValue(clang::ASTContext&)
const: Assertion `success && "Illegal argument to getIntegerConstantExpr"'
failed.

Note that non-constant offsetof is a gcc extension.


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