[PATCH] D31839: make -Winteger-overflow find overflows in function arguments

Nick Lewycky via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 11 22:50:41 PDT 2017


nlewycky added a comment.

In https://reviews.llvm.org/D31839#724551, @ahatanak wrote:

> OK, thanks for looking into it. Warnings for ObjCMessageExpr can probably be implemented in a separate patch.
>
> It looks like clang still doesn't issue overflow warnings when the called functions have a void return. Should we try to fix it in this patch too?
>
>   void foo(int);
>  
>   void test0() {
>     foo(4068 * 1024 * 1024); // no warnings
>   }
>


That testcase and the ObjCMessageExpr can go together in another patch where we fix visiting of non-literal-type expressions. This patch is really about inconsistent visiting of the arguments of a CallExpr.

There's a problem with this patch, we sometimes revisit nodes leading to exponential time. I've written a fix to that locally but it's not upstreamable quality yet.


https://reviews.llvm.org/D31839





More information about the cfe-commits mailing list