<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Type merging in some PDBs results in bad pointer typedefs"
   href="https://bugs.llvm.org/show_bug.cgi?id=37492">37492</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Type merging in some PDBs results in bad pointer typedefs
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>COFF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>amccarth@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The type records for some typedefs, like `std::vector<unsigned
char>::const_pointer`, sometimes do not have the correct pointee type.  It
should be `const unsigned char`, but it's a bitfield.  Similar problem for
`const_reference` and `std::array<unsigned char>`.

Discovered in the webview.dll.pdb from a debug Chrome build.

You can observe the problem by running `llvm-pdbutil pretty -types
webview.dll.pdb`, which will effective assert on the bad type.  If you use
`dump -types`, you can manually follow the type IDs to an `LF_BITFIELD`.

This does not happen for all PDBs.

Here are some excerpts to illustrate:

```
0x3E25 | LF_CLASS [size = 124] `std::vector<unsigned
char,std::allocator<unsigned char> >`
             unique name: `.?AV?$vector@EV?$allocator@E@std@@@std@@`
             vtable: <no type>, base list: <no type>, field list: 0x3E24
             options: contains nested class | has unique name
```

If we look in the field list for 0x3E24, we find:

```
    - LF_NESTTYPE [name = `const_pointer`, parent = 0x27F1]
```

Following the parent:

```
    0x27F1 | LF_POINTER [size = 12]
             referent = 0x22C6, mode = pointer, opts = None, kind = ptr32
```

And finally, the referent leads to:

```
    0x22C6 | LF_BITFIELD [size = 12]
             type = 0x0020 (unsigned char), bit offset = 0, # bits = 1
```</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>