]> granicus.if.org Git - clang/commit
[analyzer] Check that an ObjCIvarRefExpr's base is non-null even as an lvalue.
authorJordan Rose <jordan_rose@apple.com>
Sat, 22 Sep 2012 01:24:38 +0000 (01:24 +0000)
committerJordan Rose <jordan_rose@apple.com>
Sat, 22 Sep 2012 01:24:38 +0000 (01:24 +0000)
commit991bcb4370fe849603346ebbddc8dd47bc29d235
tree13ae959d39be697057da8cdedf857e2680e7dd64
parentdd1d7d88f1fe6d7d7e79acaec3f83bc10d9f7b97
[analyzer] Check that an ObjCIvarRefExpr's base is non-null even as an lvalue.

Like with struct fields, we want to catch cases like this early,
so that we can produce better diagnostics and path notes:

  PointObj *p = nil;
  int *px = &p->_x; // should warn here
  *px = 1;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164442 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
test/Analysis/ivars.m
test/Analysis/misc-ps.m
test/Analysis/null-deref-path-notes.m [new file with mode: 0644]