summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-08-29 22:49:34 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-08-29 22:49:34 +0000
commitbc562eec6767f39fa0ffac8308a9d09ec4df68d5 (patch)
treef1f4b942b42d9085bd4223c90b86eb21985ae771 /lib/Frontend/CompilerInvocation.cpp
parentdbc57bfc8e56a71dd932ca04b7c211e5bf44e80e (diff)
downloadclang-bc562eec6767f39fa0ffac8308a9d09ec4df68d5.tar.gz
Fix silent wrong-code bugs and crashes with designated initialization.
We failed to correctly handle the 'holes' left behind by designated initializers in VerifyOnly mode. This would result in us thinking that a designated initialization would be valid, only to find that it is not actually valid when we come to build it. In a +Asserts build, that would assert, and in a -Asserts build, that would silently lose some part of the initialization or crash. With this change, when an InitListExpr contains any designators, we now always build a structured list so that we can track the locations of the 'holes' that we need to go back and fill in. We could in principle do better: we only need the structured form if there is a designator that jumps backwards (and can otherwise check for the holes as we progress through the initializer list), but dealing with that turns out to be rather complicated, so it's not done as part of this patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions