Skip to content
Snippets Groups Projects
  • David Majnemer's avatar
    3e25c0c7
    CodeGen: Don't crash when initializing pointer-to-member fields in bases · 3e25c0c7
    David Majnemer authored
    Clang uses two types to talk about a C++ class, the
    NonVirtualBaseLLVMType and the LLVMType.  Previously, we would allow one
    of these to be packed and the other not.
    
    This is problematic.  If both don't agree on a common subset of fields,
    then routines like getLLVMFieldNo will point to the wrong field.  Solve
    this by copying the 'packed'-ness of the complete type to the
    non-virtual subobject.  For this to work, we need to take into account
    the non-virtual subobject's size and alignment when we are computing the
    layout of the complete object.
    
    This fixes PR21089.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218577 91177308-0d34-0410-b5e6-96231b3b80d8
    3e25c0c7
    History
    CodeGen: Don't crash when initializing pointer-to-member fields in bases
    David Majnemer authored
    Clang uses two types to talk about a C++ class, the
    NonVirtualBaseLLVMType and the LLVMType.  Previously, we would allow one
    of these to be packed and the other not.
    
    This is problematic.  If both don't agree on a common subset of fields,
    then routines like getLLVMFieldNo will point to the wrong field.  Solve
    this by copying the 'packed'-ness of the complete type to the
    non-virtual subobject.  For this to work, we need to take into account
    the non-virtual subobject's size and alignment when we are computing the
    layout of the complete object.
    
    This fixes PR21089.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218577 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.