[LLVMdev] SAFECode Source Code Released
John McCall
rjmccall at apple.com
Tue Nov 17 00:43:19 PST 2009
Török Edwin wrote:
> Ok, then converting from void** to PoolSlab** can be done by going
> through void* as an intermediary type?
>
The violation is not in how you're converting the void** to a
PoolSlab**. That array is forever and always an array of void*s, and no
amount of conversion will make it not a strict-aliasing violation to
load PoolSlab*s from it. All your patch is doing is introducing enough
indirection to disable the warning.
The only ways to avoid the aliasing violation are to (1) have the array
be a PoolSlab** in the first place or (2) actually read and write void*s
from the array, casting to and from PoolSlab* as appropriate.
John.
More information about the llvm-dev
mailing list