Mercurial > projects > ldc
diff ir/irvar.cpp @ 1309:0c03ba6f7c24
Fixed deal breaker bug for more-at-once compilation when any module contained aggregates. Fixes ticket #272 .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Thu, 07 May 2009 02:10:29 +0200 |
parents | 212ec2d9d176 |
children | 8d086d552909 |
line wrap: on
line diff
--- a/ir/irvar.cpp Wed May 06 20:29:27 2009 +0200 +++ b/ir/irvar.cpp Thu May 07 02:10:29 2009 +0200 @@ -36,14 +36,22 @@ ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -IrField::IrField(VarDeclaration* v, size_t idx, size_t offset) : IrVar(v) +IrField::IrField(VarDeclaration* v) : IrVar(v) { - index = idx; - unionOffset = offset; - constInit = NULL; - assert(V->ir.irField == NULL && "field for this variable already exists"); V->ir.irField = this; + + if (v->aggrIndex) + { + index = v->aggrIndex; + unionOffset = 0; + } + else + { + index = 0; + unionOffset = v->offset; + } + constInit = NULL; } extern LLConstant* get_default_initializer(