[PATCH] Division by zero

Anders Rönnholm Anders.Ronnholm at evidente.se
Tue Apr 1 07:45:32 PDT 2014


Hi,

I have a new patch i'd like to get reviewed for a different kind of division by zero than the already existing one. 

This patch check for division by variable that is later compared against 0. Either the comparison is useless or there is division by zero.
 
It catches scenarios like these:
 
void f(int y) {
x = 100 / y;
if (y == 0) {}
}
 
//Anders
-------------- next part --------------
A non-text attachment was scrubbed...
Name: divzero2.diff
Type: text/x-patch
Size: 10571 bytes
Desc: divzero2.diff
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140401/3c5b33a6/attachment.bin>


More information about the cfe-commits mailing list