http://llvm.org/bugs/show_bug.cgi?id=17073

Zhendong Su <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #2 from Zhendong Su <[email protected]> ---
> int foo(int p1, long long p2) {
>   /* 'p1 == 2' and 'p2' == 0
>    * This implies 'p1 % p2' is UB.
>    */
>   return p2 == 0 ? 0 : p1 % p2;
> }

Bill, we'll need to be careful here. Since p2 == 0 holds, p1 % p2 isn't
executed at all.  This is exactly how we guard for division by zeros. 

The code is valid and doesn't have any UBs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to