- Nov 13, 2012
-
-
Anna Zaks authored
and other functions. When these functions return null, the pointer is not freed by them/ownership is not transfered. So we should allow the user to free the pointer by calling another function when the return value is NULL. llvm-svn: 167813
-
Anna Zaks authored
llvm-svn: 167790
-
Anna Zaks authored
conditions. The adjustment is needed only in case of dynamic dispatch performed by the analyzer - when the runtime declaration is different from the static one. Document this explicitly in the code (by adding a helper). Also, use canonical Decls to avoid matching against the case where the definition is different from found declaration. This fix suppresses the testcase I added in r167762, so add another testcase to make sure we do test commit r167762. llvm-svn: 167780
-
- Nov 12, 2012
-
-
Anna Zaks authored
Suppresses a leak false positive (radar://12663777). In addition, we'll need to rewrite the adjustReturnValue() method not to return UnknownVal by default, but rather assert in cases we cannot handle. To make it possible, we need to correctly handle some of the edge cases we already know about. llvm-svn: 167762
-
- Nov 10, 2012
-
-
Jordan Rose authored
Previously, RegionStore was being VERY conservative in saying that because p[i].x and p[i].y have a concrete base region of 'p', they might overlap. Now, we check the chain of fields back up to the base object and check if they match. This only kicks in when dealing with symbolic offset regions because RegionStore's "base+offset" representation of concrete offset regions loses all information about fields. In cases where all offsets are concrete (s.x and s.y), RegionStore will already do the right thing, but mixing concrete and symbolic offsets can cause bindings to be invalidated that are known to not overlap (e.g. p[0].x and p[i].y). This additional refinement is tracked by <rdar://problem/12676180>. <rdar://problem/12530149> llvm-svn: 167654
-
- Nov 07, 2012
-
-
Jordan Rose authored
Patch by Sean McBride! llvm-svn: 167537
-
Jordan Rose authored
No functionality change; this checker is only used for documentation. llvm-svn: 167522
-
- Nov 06, 2012
- Nov 05, 2012
-
-
Jordan Rose authored
As Anna pointed out, ProgramStateTrait.h is a relatively obscure header, and checker writers may not know to look there to add their own custom state. The base macro that specializes the template remains in ProgramStateTrait.h (REGISTER_TRAIT_WITH_PROGRAMSTATE), which allows the analyzer core to keep using it. llvm-svn: 167385
-
- Nov 03, 2012
-
-
NAKAMURA Takumi authored
0 (as nullptr) is incompatible to pointer in type matching on msvc. llvm-svn: 167355
-
Anna Zaks authored
This will simplify checkers that need to register for leaks. Currently, they have to register for both: check dead and check end of path. I've modified the SymbolReaper to consider everything on the stack dead if the input StackLocationContext is 0. (This is a bit disruptive, so I'd like to flash out all the issues asap.) llvm-svn: 167352
-
Anna Zaks authored
llvm-svn: 167351
-
Anna Zaks authored
Node builders should manage the nodes, not the context. llvm-svn: 167350
-
Jordan Rose authored
llvm-svn: 167340
-
Jordan Rose authored
llvm-svn: 167339
-
Jordan Rose authored
These are CallEvent-equivalents of helpers already accessible in CheckerContext, as part of making it easier for new checkers to be written using CallEvent rather than raw CallExprs. llvm-svn: 167338
-
Jordan Rose authored
Also, Decls already carry a pointer to the ASTContext, so there's no need to pass an extra argument to the predicate. llvm-svn: 167337
-
- Nov 02, 2012
-
-
Anna Zaks authored
llvm-svn: 167316
-
Jordan Rose authored
Add FIXMEs for the traits visible from multiple translation units. Currently the macros hide their key types in an anonymous namespace. llvm-svn: 167277
-
Jordan Rose authored
Also, move the REGISTER_*_WITH_PROGRAMSTATE macros to ProgramStateTrait.h. This doesn't get rid of /all/ explicit uses of ProgramStatePartialTrait, but it does get a lot of them. llvm-svn: 167276
-
Jordan Rose authored
No functionality change. llvm-svn: 167275
-
- Nov 01, 2012
-
-
Jordan Rose authored
llvm-svn: 167189
-
Jordan Rose authored
No functionality change. llvm-svn: 167187
-
Jordan Rose authored
(and the same for isFalse) No functionality change. llvm-svn: 167186
-
- Oct 31, 2012
-
-
Anna Zaks authored
Thanks Ted. llvm-svn: 167176
-
Jordan Rose authored
Previously, every call to a ConstraintManager's isNull would do a full assumeDual to test feasibility. Now, ConstraintManagers can override checkNull if they have a cheaper way to do the same thing. RangeConstraintManager can do this in less than half the work. <rdar://problem/12608209> llvm-svn: 167138
-
Anna Zaks authored
llvm-svn: 167099
-
Anna Zaks authored
IdentifierInfo. Ee: C++ copy constructors. llvm-svn: 167092
-
- Oct 30, 2012
-
-
Ted Kremenek authored
llvm-svn: 167002
-
Anna Zaks authored
llvm-svn: 167001
-
Anna Zaks authored
The ImmutableMap should not be the key into the GDM map as there could be several entries with the same map type. Thanks, Jordan. This complicates the usage of the macro a bit. When we want to retrieve the whole map, we need to use another name. Currently, I set it to be Name ## Ty as in "type of the map we are storing in the ProgramState". llvm-svn: 167000
-
Anna Zaks authored
llvm-svn: 166999
-
Jordan Rose authored
Patch by Sean McBride! llvm-svn: 166995
-
Jordan Rose authored
This is a syntactic checker aimed at helping iOS programmers correctly subclass and override the methods of UIViewController. While this should eventually be covered by the 'objc_requires_super' attribute, this checker can be used with the existing iOS SDKs without any header changes. This new checker is currently named 'alpha.osx.cocoa.MissingSuperCall'. Patch by Julian Mayer! llvm-svn: 166993
-
- Oct 29, 2012
-
-
Anna Zaks authored
No need for the auxiliary flag. No need to generate a leak node when there is no error. llvm-svn: 166977
-
Anna Zaks authored
This is an example checker for catching fopen fclose API misuses. llvm-svn: 166976
-
Anna Zaks authored
- Adding Immutable Map to GDM and getIdentifierInfo helper method. llvm-svn: 166975
-
Jordan Rose authored
Our one basic suppression heuristic is to assume that functions do not usually return NULL. However, when one of the arguments is NULL it is suddenly much more likely that NULL is a valid return value. In this case, we don't suppress the report here, but we do attach /another/ visitor to go find out if this NULL argument also comes from an inlined function's error path. This new behavior, controlled by the 'avoid-suppressing-null-argument-paths' analyzer-config option, is turned off by default. Turning it on produced two false positives and no new true positives when running over LLVM/Clang. This is one of the possible refinements to our suppression heuristics. <rdar://problem/12350829> llvm-svn: 166941
-
Jordan Rose authored
Additionally, don't collect PostStore nodes -- they are often used in path diagnostics. Previously, we tried to track null arguments in the same way as any other null values, but in many cases the necessary nodes had already been collected (a memory optimization in ExplodedGraph). Now, we fall back to using the value of the argument at the time of the call, which may not always match the actual contents of the region, but often will. This is a precursor to improving our suppression heuristic. <rdar://problem/12350829> llvm-svn: 166940
-