llvm-project
2162a18f - [clang][CodeGen] Check initializer of zero-size fields for nullptr (#109271)

Commit
1 year ago
[clang][CodeGen] Check initializer of zero-size fields for nullptr (#109271) In https://github.com/llvm/llvm-project/pull/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 https://github.com/llvm/llvm-project/pull/96422 we can get here when compiling `C`, but `Init` need not exist. This patch adds a null-check to account for this situtation.
Author
Parents
Loading