[LLVMdev] Changing the value returned by sizeof

Peter Conn conn.peter at gmail.com
Wed Apr 9 01:28:29 PDT 2014


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>


More information about the llvm-dev mailing list