[cfe-dev] Catching -fsanitize=integer generate error ?

Brian Cain via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 6 05:52:43 PST 2015


You can use "UBSAN_OPTIONS=halt_on_error=1" in the environment to detect
the problem without letting execution continue.

Maybe you could use -fsanitize-trap=undefined and -ftrap=function?
http://clang.llvm.org/docs/UsersManual.html#cmdoption-ftrap-function



On Fri, Nov 6, 2015 at 6:34 AM, Stéphane Letz <cfe-dev at lists.llvm.org>
wrote:

> Hi,
>
> We are trying to use -fsanitize=integer to detect integer overflow errors.
> The message "runtime error: signed integer overflow" is generated, but is
> seems not as a catchable C++ exception. We would like to use try {…code
> that possibly overflow…. } catch (std::runtime_error& e) { } kind of code
> to handle the exception.
>
> It that possible? If not is there any alternative to detect integer
> overflow errors ?
>
> Thanks.
>
> Stéphane Letz
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



-- 
-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151106/ae4c48fe/attachment.html>


More information about the cfe-dev mailing list