You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.