vsk added a comment.

In https://reviews.llvm.org/D25199#559849, @pcc wrote:

> It seems to me that this sanitizer would break the semantics of otherwise 
> well-defined programs. For example:
>
>   int *x = nullptr;
>   delete x;
>   if (x != nullptr) {
>     // normally unreachable
>   }
>
>
> It may be that a null comparison would be enough to avoid the semantics 
> break, but I am not certain of this.


Maybe we could call this `-fpoison-dangling-ptrs` and force users to be more 
explicit about opting into this behavior change. That would remove some of the 
constraints usually placed on new sanitizer checks (e.g support for executing 
after the error triggers, support for custom trap functions).


https://reviews.llvm.org/D25199



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

Reply via email to