diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-28 21:23:50 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-28 21:23:50 +0000 |
commit | 72ab27732ea7a42d756a1e79727f86fbe391b42b (patch) | |
tree | 18d34616df378ea572eda65f8e07ab5ca94c123d /lib/Sema/SemaInit.cpp | |
parent | 3c88301b551add30e9a4b59af325534643dc4b21 (diff) |
When processing an InitListExpr and skipping the initialization of an invalid
record, skip at least one element from the InitListExpr to avoid an infinite
loop if we're initializing an array of unknown bound.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index c4314b6f6c..42fc84d432 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -1316,6 +1316,8 @@ void InitListChecker::CheckStructUnionTypes(const InitializedEntity &Entity, // If the record is invalid, some of it's members are invalid. To avoid // confusion, we forgo checking the intializer for the entire record. if (structDecl->isInvalidDecl()) { + // Assume it was supposed to consume a single initializer. + ++Index; hadError = true; return; } |