diff gen/classes.cpp @ 1262:ec1d9dc1d32a

Fixed struct default initializers.
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sat, 25 Apr 2009 18:26:54 +0200
parents 752bed475b75
children dd135ff697fa
line wrap: on
line diff
--- a/gen/classes.cpp	Wed Apr 22 14:49:49 2009 -0600
+++ b/gen/classes.cpp	Sat Apr 25 18:26:54 2009 +0200
@@ -187,8 +187,7 @@
 {
     tc->sym->codegen(Type::sir);
 
-    size_t presz = 2*getTypePaddedSize(DtoSize_t());
-    uint64_t n = getTypePaddedSize(tc->ir.type->get()) - presz;
+    uint64_t n = tc->sym->structsize - PTRSIZE * 2;
 
     // set vtable field seperately, this might give better optimization
     LLValue* tmp = DtoGEPi(dst,0,0,"vtbl");