Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][CodeGen] Check initializer of zero-size fields for nullptr #9313

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

Michael137
Copy link

In llvm#96422 we started treating empty records as zero-sized for the purpose of layout. In C, empty fields were never considered isZeroSize, so we would never have tried to call Init->hasSideEffects on them. But since
llvm#96422 we can get here when compiling C, but Init need not exist. This patch adds a null-check to account for this situtation.

(cherry picked from commit 2162a18)

…lvm#109271)

In llvm#96422 we started treating
empty records as zero-sized for the purpose of layout. In `C`, empty
fields were never considered `isZeroSize`, so we would never have tried
to call `Init->hasSideEffects` on them. But since
llvm#96422 we can get here when
compiling `C`, but `Init` need not exist. This patch adds a null-check
to account for this situtation.

(cherry picked from commit 2162a18)
@Michael137 Michael137 merged commit 4f20946 into stable/20240723 Sep 20, 2024
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.

1 participant