[LLVMbugs] [Bug 17578] New: Clang crash compiling offsetof member of virtual base

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 14 14:52:24 PDT 2013


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

            Bug ID: 17578
           Summary: Clang crash compiling offsetof member of virtual base
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Yunzhong_Gao at playstation.sony.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Compiling the following test case caused clang front end to crash.

/* clang -S -o - test.cpp */
#include <cstddef>

struct Base {
  int a;
};

struct Derived : virtual Base 
{};

void foo() 
{ 
  int xx = offsetof(Derived, a);
}
/* end test.cpp */

clang: llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp:1849: llvm::Value*
{anonymous}::ScalarExprEmitter::VisitOffsetOfExpr(clang::OffsetOfExpr*):
Assertion `i < RL.getFieldCount() && "offsetof field in wrong type"' failed.

clang version 3.4 (trunk 191913)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

-- 
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/20131014/c9bf2c84/attachment.html>


More information about the llvm-bugs mailing list