[cfe-commits] -fbounds-checking
Chandler Carruth
chandlerc at google.com
Mon May 7 13:50:29 PDT 2012
Have you looked at AddressSanitizer?
http://clang.llvm.org/docs/AddressSanitizer.html
On Mon, May 7, 2012 at 11:54 AM, Nuno Lopes <nunoplopes at sapo.pt> wrote:
> Hi,
>
> I would like to add a new option to clang: -fbounds-checking. It emits
> run-time bounds checks for array/pointers dereferencing based on
> LLVM's object size built-in. The code to emit the checks is already in
> clang; it's just a matter of wiring the flag.
> The other change is to make -fcatch-undefined-behavior imply
> -fbounds-checking (so that it keeps doing these kinds of checks).
>
> This flag supports an additional integer parameter to control the
> amount of run-time performance penalty you're willing to afford. For
> example, -fbounds-checking=1 will only resolve stuff at compile-time,
> while at level 2 it can defer some stuff to run-time. This will come
> in a separate patch to LLVM.
>
> Comments, ideas, etc?
>
> Thanks,
> Nuno
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120507/03fb9f64/attachment.html>
More information about the cfe-commits
mailing list