aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WindowsResource.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
commitcd839ccf9985884c25e87cc34f658c02c5e1cd93 (patch)
treeee2c1bcc407711493f1e60c6760f6ba4fdde56d7 /llvm/lib/Object/WindowsResource.cpp
parent33e9be6c8b5aad9c164e082c7e78cc08dd13cac1 (diff)
downloadllvm-cd839ccf9985884c25e87cc34f658c02c5e1cd93.zip
llvm-cd839ccf9985884c25e87cc34f658c02c5e1cd93.tar.gz
llvm-cd839ccf9985884c25e87cc34f658c02c5e1cd93.tar.bz2
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. llvm-svn: 370419
Diffstat (limited to 'llvm/lib/Object/WindowsResource.cpp')
0 files changed, 0 insertions, 0 deletions