http://llvm.org/bugs/show_bug.cgi?id=3269
Summary: clang::CompoundLiteralExpr::Init can be NULL,
consequently getInitializer() must use cast_or_null.
Product: clang
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: AST
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
To see a case where CompoundLiteralExpr::Init is null:
- modify getSourceRange() adding `assert(Init && "Init CAN be null.");' as
first line of the function body.
- compile clang
- exec the new clang with this code:
---->
struct S {
char a[2]; int b; };
int f() {
return __builtin_offsetof(struct S, b); }
----<
The assertion will fail, and since the compound literal do not actually have an
init expression it is correct.
Yet, the getInitializer() functions use cast() that crashes in case of null
pointers. It must be changed to cast_or_null.
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs