[cfe-dev] Struct init codegen and padding

Sanghyeon Seo sanxiyn at gmail.com
Thu Jan 24 20:09:33 PST 2008


This test program crashes in CodeGen.
struct s { short a; int b; } x = {1, 1};

"struct s" converts to LLVM type {i16, i8, i8, i32}, padded with i8.
CodeGen attempts llvm::ConstantStruct::get({i16, i8, i8, i32}, {1, 1})
and crashes, since the type has 4 elements but initializer has only 2.

-- 
Seo Sanghyeon



More information about the cfe-dev mailing list