[PATCH] D12181: [sanitizer] Add -fsanitize-trap-function.

Josh Gao via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 16:29:25 PDT 2015


jmgao added a comment.

In http://reviews.llvm.org/D12181#229467, @rsmith wrote:

> In http://reviews.llvm.org/D12181#229358, @rsmith wrote:
>
> > Can you please give a brief description of the motivation for this change? When would it be appropriate to use this rather than `-ftrap-function`?
>
>
> I'd still like an answer to this. It's not clear to me what the purpose of this is, and why you'd want a custom runtime hook for sanitizer traps but not other traps. The only time we emit a trap using `-ftrap-function` where there is no corresponding sanitizer is for `__builtin_trap()`; is the intention that you still want a normal trap for that builtin?


The goal is to be able to give a useful fsanitize-specific error message ("fsanitize trap occurred"), while not lying and saying this for non-sanitize traps.


http://reviews.llvm.org/D12181





More information about the cfe-commits mailing list