mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-12 07:34:50 +00:00
PArray's size should take alignment into account.
This commit is contained in:
parent
6c1f3a1396
commit
93cbdd37a5
2 changed files with 5 additions and 1 deletions
|
@ -638,7 +638,10 @@ PArray::PArray(PType *etype, unsigned int ecount)
|
|||
: ElementType(etype), ElementCount(ecount)
|
||||
{
|
||||
Align = etype->Align;
|
||||
Size = etype->Size * ecount;
|
||||
// Since we are concatenating elements together, the element size should
|
||||
// also be padded to the nearest alignment.
|
||||
ElementSize = (etype->Size + (etype->Align - 1)) & ~(etype->Align - 1);
|
||||
Size = ElementSize * ecount;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -355,6 +355,7 @@ public:
|
|||
|
||||
PType *ElementType;
|
||||
unsigned int ElementCount;
|
||||
unsigned int ElementSize;
|
||||
|
||||
virtual bool IsMatch(intptr_t id1, intptr_t id2) const;
|
||||
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const;
|
||||
|
|
Loading…
Reference in a new issue