Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #260 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Assertion `definit->getType() == type->irtype->getPA().get() && "class initializer type mismatch"' failed

Reported by: mrmonday Assigned to: ChristianK
Priority: major Milestone:
Component: unspecified Version: hg tip
Keywords: Cc:

Description

When compiling:

struct vec2 {

        union {
                float[2] cell;

                struct {
                        union { float x; float r; }
                        union { float y; float g; }
                }
        }

        const static vec2 zero = { x : 0f, y : 0f };

}

class HBoxLayout {
        vec2 padding    = vec2.zero;
}

class HBox {
        HBoxLayout layout;
        this() {
                this.layout = new HBoxLayout;
        }

}

On linux x86-64 using:

LLVM D Compiler rev. 1255:9014d7f0433f (2009-04-22 03:08 +0200)
based on DMD v1.042 and llvm 2.5 (2009-03-03 04:36:03 +0000)

I get the following assertion:

ldc: /home/robert/d/comp/ldc/ir/irclass.cpp:280: llvm::Constant* IrStruct::createClassDefaultInitializer(): Assertion `definit->getType() == type->irtype->getPA().get() && "class initializer type mismatch"' failed.
0   ldc       0x0000000000cecdd1
1   libc.so.6 0x00007f71bce74150
2   libc.so.6 0x00007f71bce740c5 gsignal + 53
3   libc.so.6 0x00007f71bce755e3 abort + 387
4   libc.so.6 0x00007f71bce6d0e9 __assert_fail + 233
5   ldc       0x0000000000665d20 IrStruct::createClassDefaultInitializer() + 816
6   ldc       0x0000000000672a05 IrStruct::getDefaultInit() + 37
7   ldc       0x0000000000608d7f DtoResolveClass(ClassDeclaration*) + 655
8   ldc       0x000000000065e7e1 Module::genLLVMModule(Ir*) + 609
9   ldc       0x000000000062396b main + 4891
10  libc.so.6 0x00007f71bce60546 __libc_start_main + 230
11  ldc       0x0000000000546e39

Change History

04/22/09 15:11:16 changed by mrmonday

If you comment out "float[2] cell;" this compiles.

04/26/09 21:41:34 changed by lindquist

  • status changed from new to closed.
  • resolution set to fixed.

fixed in rev [1270]

Copyright © 2008, LDC Development Team.