[llvm-bugs] [Bug 37492] New: Type merging in some PDBs results in bad pointer typedefs

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 16 17:32:55 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37492

            Bug ID: 37492
           Summary: Type merging in some PDBs results in bad pointer
                    typedefs
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: amccarth at google.com
                CC: llvm-bugs at lists.llvm.org

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 at EV?$allocator at 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
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180517/38d5d22d/attachment.html>


More information about the llvm-bugs mailing list