Skip to content

Conversation

@2over12
Copy link
Contributor

@2over12 2over12 commented May 31, 2023

Clang 16 added a semantic check for flexible array members that relies on grabbing sourceloc info for array types that are the last member of a union. If the sourceloc info is empty dyn_cast<IntegerLiteral>(CTL.getSizeExpr()) will crash because getSizeExpr will be null and dyn_cast asserts a nonnulll input. Another plausible fix would be to do dyn_cast_or_null here but that would result in false. Still determining the best patch/testing

@2over12
Copy link
Contributor Author

2over12 commented May 31, 2023

Any preferences on how we do clang patches like this? ie. gated behind a flag?

@2over12 2over12 marked this pull request as ready for review May 31, 2023 14:32
@2over12 2over12 requested review from Ninja3047 and ekilmer as code owners May 31, 2023 14:32
Copy link
Collaborator

@Ninja3047 Ninja3047 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm fine with including it since it's not adding new stuff and is just a bug fix

@ekilmer ekilmer merged commit 5992136 into master May 31, 2023
@ekilmer ekilmer deleted the ian/clang-patch-for-invalid-sourcelocs branch May 31, 2023 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants