[LLVMbugs] [Bug 16856] New: clang crashes during CodeGen if _GUID is incomplete

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Aug 10 21:30:12 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16856

            Bug ID: 16856
           Summary: clang crashes during CodeGen if _GUID is incomplete
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider the following program:
struct __declspec(uuid("{12345678-1234-1234-1234-1234567890aB}")) uuid;
const struct _GUID *G = &__uuidof(uuid);

We will crash in clang::CodeGen::CodeGenModule::EmitUuidofInitializer because
our attempt to enter clang::CodeGen::CodeGenModule::EmitConstantValue will be
foiled: the type of the constant value is incomplete.

Being more compatible with cl would yield us a "straightforward" result with
the following sequence:
1. struct __s_GUID would be a builtin type with the same layout as struct
_GUID.
2. struct _GUID would be a known incomplete type.
3. The constant would be emitted with type struct __s_GUID.
4. __uuidof would give back a pointer of type struct _GUID.

-- 
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/20130811/0aa5b723/attachment.html>


More information about the llvm-bugs mailing list