[cfe-dev] Is this an over alignment bug for ARM?

Zhao, Weiming via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 18 16:32:02 PST 2016


Hi Tim,

Thanks for the answer.
So "new" or malloc should guarantee that it returns  a at-least 8-byte 
aligned "this" pointer, is that correct?

Thank,s
Weiming


On 2/18/2016 2:25 PM, Tim Northover wrote:
> Hi Weiming,
>
> On 18 February 2016 at 12:56, Zhao, Weiming via cfe-dev
> <cfe-dev at lists.llvm.org> wrote:
>> I'm debugging an Android code which caused data violation fault and it seems Clang is generating a store with over alignment.
> I think that's valid. The "long long" member means that the entire
> class must be 8-byte aligned (under AAPCS), in particular the this
> pointer itself. And then there are 4 bytes of padding between mBaseLen
> and mOffset to ensure mOffset actually is aligned.
>
> Or am I misreading something?
>
> Cheers.
>
> Tim.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation




More information about the cfe-dev mailing list