[LLVMdev] Changing the value returned by sizeof

waxiadao@gmail.com
Wed, 09 Apr 2014 09:28:17 -0000

a is a pointer.The size of a pointer always equals the size of an
int,doesn't it?
在 2014-4-9 下午4:32，"Peter Conn" <conn.peter at gmail.com>写道：

> Hello,
>
> I'm replacing a struct with another struct of a different size. A
problem
> arises when the following line occurs in the source code:
>
> MyStruct *a = malloc(sizeof(a));
>
> The 'sizeof(a)' is turned into a constant in the LLVM IR, resulting
in the
> wrong amount of memory being allocated for the struct. Is there any way to
> find all the constants that have arisen from sizeof?
>
> Thanks, Peter
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20140409/4ebb41a9/attachment.html>