Open ZequanWu opened 4 hours ago
To help make things clear, https://github.com/llvm/llvm-project/pull/91991did not introduce the crash, it exposed the crash in Chromium code because it ran the analysis machinery on code inside field initializers. The crash happens outside of field initializers too, but the problematic code is only in a field initializer in Chromuim.
Once the underlying issue is fixed, the revert of https://github.com/llvm/llvm-project/pull/91991 can be reverted to reland it, as there's no related bug in that PR afaik.
@haoNoQ I am no longer working in Chromium so I won't have a lot of time to follow up here. And the bug appears to be in the handling of casts in AnalysisBasedWarnings at https://github.com/llvm/llvm-project/blob/7d20ea9d32954e8e5becab8495fa509a3f67b710/clang/lib/Sema/AnalysisBasedWarnings.cpp#L2271-L2277 Could you handle triaging this?
A further reduced repro for https://godbolt.org/z/vcv8d6sYr: https://godbolt.org/z/1vn6adWhc
@danakj I will work on it.
Trunk clang crashes with
-Wunsafe-buffer-usage
: https://godbolt.org/z/Pjj413W68 and https://godbolt.org/z/j4hnY3eEz.91991 (reverted) introduced the same crash with
-Wunsafe-buffer-usage
: https://godbolt.org/z/vcv8d6sYr, which is likely due to the same underlying issue.