On Feb 6, 2013, at 5:07 PM, Anna Zaks <[email protected]> wrote:

> Attached is a new patch, which uses GDM to store the VarDecls of globals 
> previously initialized along the path.
> 
> Thanks for the suggestion,
> Anna.

Thanks Anna.  Looks like the right approach, but this looks suspicious:

+  const VarDecl *VD = dyn_cast<VarDecl>(D);
+
+  if (!D || !VD) {
     //TODO:AZ: remove explicit insertion after refactoring is done.
     Dst.insert(Pred);
     return;
   }


If 'D' can be null, then the dyn_cast<> can crash.  The safe code would be:

const VarDecl *VD = dyn_cast_or_null<VarDecl>(D);
if (!VD) {
  …
}


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

Reply via email to