comparison ir/irstruct.cpp @ 1351:8d501abecd24

Initial (but disabled) fix for ticket #294 , the actual part that fixes the bug is in a #if 0 block as I'm afraid it will cause regressions. I'm most likely not going to be around tonight, and maybe not tomorrow as well, so I'm pushing it in case someone wants to run some serious testing/investigate the problem noted in llvmhelpers.cpp : realignOffset .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Thu, 14 May 2009 17:20:17 +0200
parents dd135ff697fa
children 65505c9d70f5
comparison
equal deleted inserted replaced
1350:15e9762bb620 1351:8d501abecd24
167 167
168 // get next aligned offset for this field 168 // get next aligned offset for this field
169 size_t alignedoffset = offset; 169 size_t alignedoffset = offset;
170 if (!packed) 170 if (!packed)
171 { 171 {
172 size_t alignsize = vd->type->alignsize(); 172 alignedoffset = realignOffset(alignedoffset, vd->type);
173 alignedoffset = (offset + alignsize - 1) & ~(alignsize - 1);
174 } 173 }
175 174
176 // insert explicit padding? 175 // insert explicit padding?
177 if (alignedoffset < vd->offset) 176 if (alignedoffset < vd->offset)
178 { 177 {
353 352
354 // get next aligned offset for this field 353 // get next aligned offset for this field
355 size_t alignedoffset = offset; 354 size_t alignedoffset = offset;
356 if (!packed) 355 if (!packed)
357 { 356 {
358 size_t alignsize = vd->type->alignsize(); 357 alignedoffset = realignOffset(alignedoffset, vd->type);
359 alignedoffset = (offset + alignsize - 1) & ~(alignsize - 1);
360 } 358 }
361 359
362 // insert explicit padding? 360 // insert explicit padding?
363 if (alignedoffset < vd->offset) 361 if (alignedoffset < vd->offset)
364 { 362 {