<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - ASSERT when building record layout for anonymous structures."
   href="http://llvm.org/bugs/show_bug.cgi?id=15591">15591</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ASSERT when building record layout for anonymous structures.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>samueldotj@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Assertion failure in lldb:
llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp:2271: uint64_t <anonymous
namespace>::RecordLayoutBuilder::updateExternalFieldOffset(const
clang::FieldDecl *, uint64_t): Assertion `ExternalFieldOffsets.find(Field) !=
ExternalFieldOffsets.end() && "Field does not have an external offset"' failed.
Aborted (core dumped)

I am able to reproduce the problem with the following program.

$ cat test.c
typedef struct {
    int dummy;
}type_y;

typedef struct {
    type_y y;
}type_z;

int main(int argc, char *argv[])
{
    type_z *z = 0;
    return 0;
}

$ gcc -O0 -g3 ./test.c

$ lldb a.out
Current executable set to 'a.out' (x86_64).
(lldb) p *((type_z *)0)
lldb: llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp:2271: uint64_t
<anonymous namespace>::RecordLayoutBuilder::updateExternalFieldOffset(const
clang::FieldDecl *, uint64_t): Assertion `ExternalFieldOffsets.find(Field) !=
ExternalFieldOffsets.end() && "Field does not have an external offset"' failed.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>