Do not stumble over forward declared struct member.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62288 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2009-01-16 00:50:53 +00:00
parent cf3a4487c0
commit 153745cc1f
2 changed files with 35 additions and 0 deletions

View File

@ -1791,6 +1791,11 @@ private:
{
// Add elements to structure type.
DIArray Elements = CTy.getTypeArray();
// A forward struct declared type may not have elements available.
if (Elements.isNull())
break;
// Add elements to structure type.
for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) {
DIDescriptor Element = Elements.getElement(i);