forked from OSchip/llvm-project
Attempt to fix a read-after-free running test/Sema/designated-initializers.c.
Douglas, can you check that this is doing the right thing? llvm-svn: 69298
This commit is contained in:
parent
027aa3cb0e
commit
8d25b096fa
|
@ -1234,15 +1234,15 @@ InitListChecker::CheckDesignatedInitializer(InitListExpr *IList,
|
||||||
ExpandAnonymousFieldDesignator(SemaRef, DIE, DesigIdx,
|
ExpandAnonymousFieldDesignator(SemaRef, DIE, DesigIdx,
|
||||||
cast<FieldDecl>(*Lookup.first),
|
cast<FieldDecl>(*Lookup.first),
|
||||||
Field, FieldIndex);
|
Field, FieldIndex);
|
||||||
|
D = DIE->getDesignator(DesigIdx);
|
||||||
} else {
|
} else {
|
||||||
// Name lookup found something, but it wasn't a field.
|
// Name lookup found something, but it wasn't a field.
|
||||||
SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_nonfield)
|
SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_nonfield)
|
||||||
<< FieldName;
|
<< FieldName;
|
||||||
SemaRef.Diag((*Lookup.first)->getLocation(),
|
SemaRef.Diag((*Lookup.first)->getLocation(),
|
||||||
diag::note_field_designator_found);
|
diag::note_field_designator_found);
|
||||||
|
++Index;
|
||||||
++Index;
|
return true;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
} else if (!KnownField &&
|
} else if (!KnownField &&
|
||||||
cast<RecordDecl>((*Field)->getDeclContext())
|
cast<RecordDecl>((*Field)->getDeclContext())
|
||||||
|
|
Loading…
Reference in New Issue