[clang] API: isFlexibleArrayMember will crash when the type source location associated with the Expr is invalid and macros are skipped #63074
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
crash
Prefer [crash-on-valid] or [crash-on-invalid]
Minimal reproducing example:
isFlexibleArrayMemberLike
uses the source type info to attempt to determine if the size is the result of a macro. This behavior can lead to anullptr
being passed todyn_cast
if the source range associated with the type info is an empty location.Unfortunately,
CheckArrayAccess
usesignoreTemplate
meaning in cases where the API is used for code generation (ie. when source locs will not exist) a crash will occur.An example patch that treats type info without a location as a non-macro size is available here
The text was updated successfully, but these errors were encountered: