Fixes a null dereference in some diagnostic issuing code.
Closes https://github.com/llvm/llvm-project/issues/57370
Closes https://github.com/llvm/llvm-project/issues/58028
Differential D134885
[Clang] Fix variant crashes from GH58028, GH57370 royjacobson on Sep 29 2022, 8:40 AM. Authored by
Details Fixes a null dereference in some diagnostic issuing code. Closes https://github.com/llvm/llvm-project/issues/57370
Diff Detail
Event TimelineComment Actions LFTM besides the comment about the test.
Comment Actions Apparently some of the workers crashed with the test - https://lab.llvm.org/buildbot/#/builders/216/builds/10556, but I couldn't reproduce this locally. @shafik any idea why the diagnostics might change? :/ Comment Actions I have no idea where that warning comes from. That shouldn't happen on ANY machine, since it is a public member (a is), not a private one (which should cause the diagnostic). Is that the only bot with this problem? I don't know what the 'sie' build is... but it gets me wondering if that diagnostic is getting an uninitialized version of "VerifyOnly" somewhere? It seems to me that it should be suppressing that diagnostic (if that is what VerifyOnly means here?)? It IS bizarre to me that this crash would be noticed by something that DIDN'T try to evaluate that diagnostic though, since the ICE is on that code path. Comment Actions Hmmm, uninitialized access might explain why it's runner dependent. I'll try and see if I can run it through USan. Comment Actions Only thing I can think of is the 'Aggregate' calculation for this diagnostic is going wrong somewhere. See SemaDeclcXX.cpp ~6759 for where this all happens. Aggregate IS initialized correctly to 'true' in CXXRecordDecl's DefinitionData as far as I can tell. BUT I can't imagine that some sort of optimization or mis-initialization of aggregate wouldn't cause some significant problems elsewhere. I'm thoroughly confused. Comment Actions I can't see what is going on here either. It looks like this is a windows PS5 bot. If you have access to a windows machine it might be worth trying a windows release w/ asserts build to see if it reproduces there. Comment Actions Ahhh, that exaplains it. The PlayStation targets didn't switch their default standard version to C++17, and using --std=c++14 will indeed reproduce the warnings. Some C++17 aggregate initialization changes, I guess. Thank you! Comment Actions Hah, wow! Good catch! I'd not known about the PS not changing defaults, but I DID have the DeclCXX.cpp 'setBases' function up on my screen that set that aggregate and was like, "huh... this is interesting, but I don't see how that applies here". |
Shouldn't we see a diagnostic in order to exercise the code that is being fixed?