jfb added a comment.

In D64597#1582944 <https://reviews.llvm.org/D64597#1582944>, 
@hubert.reinterpretcast wrote:

> In D64597#1581605 <https://reviews.llvm.org/D64597#1581605>, @pcc wrote:
>
> > The problem with `0xaaaaaaaa` on 32-bit is that it is likely to be a valid 
> > address.
> >
> > When I discussed this with JF I proposed a pointer initialization of 
> > `0xffffffff` which he agreed to. This value is very likely to trap when 
> > accessed (due to accesses likely wrapping to zero) and also has the benefit 
> > of being the same pattern as for floats.
>
>
> The value is very likely not to trap on some systems (due to accesses likely 
> wrapping to zero). I am not sure I have a better magic value to offer though.


On 32-bit platforms the only region that's likely to trap is the zero page. 
This seems to be the best choice, but platforms with other regions should be 
able to tune this value (i.e. I'd accept platform checks here which change the 
value on such a target).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64597/new/

https://reviews.llvm.org/D64597



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to