Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

__builtin_dump_struct crashed on struct with bitfields #49060

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR50091
Status NEW
Importance P enhancement
Reported by Pan Ruochen (ijkxyz@msn.com)
Reported on 2021-04-23 02:15:30 -0700
Last modified on 2021-04-23 02:15:30 -0700
Version 11.0
Hardware PC Windows NT
CC blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments 1.zip (64789 bytes, application/x-zip-compressed)
Blocks
Blocked by
See also
Created attachment 24795
clang created preprocessed source file and script

The following code makes clang crash. It happened on clang8, clang11 and
clang12.

typedef union {
    struct {
        int a : 2;
        int b : 2;
    };
    int asInt;
} MyBitFields;

MyBitFields r;

int main() {
    __builtin_dump_struct(&r, &printf);
    return 0;
}
Quuxplusone commented 3 years ago

Attached 1.zip (64789 bytes, application/x-zip-compressed): clang created preprocessed source file and script