[LLVMdev] Changing the value returned by sizeof

Peter Conn
Wed, 09 Apr 2014 08:28:29 -0000

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20140409/298a3b0c/attachment.html>