[PATCH] ADT: Remove misaligned pointeres from DenseMapInfo

Chandler Carruth chandlerc at google.com
Thu Jan 8 15:04:19 PST 2015


On Thu, Jan 8, 2015 at 2:59 PM, Alexey Samsonov <vonosmas at gmail.com> wrote:

>   This is where UBSan reports an error - P is not a pointer to an actual
> object, it's a fake value (0xfffff....), which is not even
>   properly aligned.
>

As I've said before, I believe UBSan is incorrect to report an error at
this point. I don't believe the cast to a pointer is UB, I believe using
that pointer for anything other than casting back to an integer is UB. We
can't even compare it to another pointer (such a compare would also produce
'false', even for comparison with itself).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150108/68ae193b/attachment.html>


More information about the llvm-commits mailing list