Anders,

Could you describe the high-level algorithm you are using?

Here is one example I would expect to work.
int test (int *x, int cond) {
  if (cond)
    *x = 1; // expected-warning
  else 
    *x = 2;  // expected-warning
  if (!x)
    return 0;
 // *x = 0;// no-warning

  return 1;
}

I have a bunch of other minor comments about the other parts of the patch that 
I will send separately.

Anna.

> On Sep 25, 2014, at 7:30 AM, Anders Rönnholm <[email protected]> 
> wrote:
> 
> Hi,
> 
> I have made a new checker similar to the divison by zero i previously 
> submitted.
> 
> This one checks for dereferences that are later compared against zero.
> 
> As requested i have made it CFG-based like how DeadStores is implemented. I 
> hope this is how you meant.
> 
> //Anders<derefthencheck.diff>


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to