diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-04-16 17:49:48 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-04-16 17:49:48 +0000 |
commit | ba79fc2d1b742e34df104aadb2780725c2a882fc (patch) | |
tree | 00ba6edd583de9190b96b27d89d28c7b5965a438 /lib/Sema/SemaInit.cpp | |
parent | 0a6bcc41e1839b5d29c1e39e7e324d13b51b7708 (diff) |
Attempt to fix a read-after-free running test/Sema/designated-initializers.c.
Douglas, can you check that this is doing the right thing?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index a0f4e4ac38..28b25565b1 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -1234,15 +1234,15 @@ InitListChecker::CheckDesignatedInitializer(InitListExpr *IList, ExpandAnonymousFieldDesignator(SemaRef, DIE, DesigIdx, cast<FieldDecl>(*Lookup.first), Field, FieldIndex); + D = DIE->getDesignator(DesigIdx); } else { // Name lookup found something, but it wasn't a field. SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_nonfield) << FieldName; SemaRef.Diag((*Lookup.first)->getLocation(), diag::note_field_designator_found); - - ++Index; - return true; + ++Index; + return true; } } else if (!KnownField && cast<RecordDecl>((*Field)->getDeclContext()) |