- Jul 29, 2011
-
-
Ted Kremenek authored
[analyzer] fix bug in malloc checker where the tracked symbol would not properly be removed from the state. llvm-svn: 136418
-
- Jul 25, 2011
-
-
Chandler Carruth authored
SourceManager and FullSourceLoc. llvm-svn: 135969
-
- Jul 23, 2011
-
-
Chris Lattner authored
them into the clang namespace. llvm-svn: 135852
-
- Jul 19, 2011
-
-
Jordy Rose authored
llvm-svn: 135518
-
Jordy Rose authored
pthread and XNU locks. Patch by Rui Paulo! llvm-svn: 135515
-
- Jul 16, 2011
-
-
Ted Kremenek authored
[analyzer] Place checking for Core Foundation "Create" rule into a proper API. No functionality change. llvm-svn: 135349
-
- Jul 15, 2011
-
-
Jordy Rose authored
Clean up UnixAPIChecker, including switching its array of BugTypes to llvm::OwningPtr<BugType> vars (the new convention). No functionality change. llvm-svn: 135255
-
Jordy Rose authored
Clean up MacOSXAPIChecker, including switching its array of BugTypes to a single llvm::OwningPtr<BugType> (the new convention). No functionality change. llvm-svn: 135250
-
- Jul 02, 2011
-
-
Eric Christopher authored
Fixes rdar://9714064 llvm-svn: 134292
-
- Jun 21, 2011
-
-
Douglas Gregor authored
MaterializeTemporaryExpr captures a reference binding to a temporary value, making explicit that the temporary value (a prvalue) needs to be materialized into memory so that its address can be used. The intended AST invariant here is that a reference will always bind to a glvalue, and MaterializeTemporaryExpr will be used to convert prvalues into glvalues for that binding to happen. For example, given const int& r = 1.0; The initializer of "r" will be a MaterializeTemporaryExpr whose subexpression is an implicit conversion from the double literal "1.0" to an integer value. IR generation benefits most from this new node, since it was previously guessing (badly) when to materialize temporaries for the purposes of reference binding. There are likely more refactoring and cleanups we could perform there, but the introduction of MaterializeTemporaryExpr fixes PR9565, a case where IR generation would effectively bind a const reference directly to a bitfield in a struct. Addresses <rdar://problem/9552231>. llvm-svn: 133521
-
- Jun 20, 2011
-
-
Jordy Rose authored
llvm-svn: 133472
-
Jordy Rose authored
llvm-svn: 133410
-
Jordy Rose authored
[analyzer] Re-enable checking for strncpy, along with a new validation of the size argument. strncat is not yet up-to-date, but I'm leaving it enabled for now (there shouldn't be any false positives, at least...) llvm-svn: 133408
-
Jordy Rose authored
[analyzer] Eliminate "byte string function" from CStringChecker's diagnostics, and make it easier to provide custom messages for overflow checking, in preparation for re-enabling strncpy checking. llvm-svn: 133406
-
- Jun 16, 2011
-
-
Jordy Rose authored
[analyzer] Clean up modeling of strcmp, including cases where a string literal has an embedded null character, and where both arguments are the same buffer. Also use nested ifs rather than early returns; in this case early returns will lose any assumptions we've made earlier in the function. llvm-svn: 133154
-
Jordy Rose authored
I will not commit without building first. I will not commit without building first. I will not commit without building first... llvm-svn: 133150
-
Jordy Rose authored
[analyzer] Cleanup: mainly 80-char violations and preferring SValBuilder::getComparisonType() to just referencing IntTy. llvm-svn: 133149
-
John McCall authored
Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
-
- Jun 15, 2011
-
-
Jordy Rose authored
- (bounded copies) Be more conservative about how much is being copied. - (str(n)cat) If we can't compute the exact final length of an append operation, we can still lower-bound it. - (stpcpy) Fix the conjured return value at the end to actually be returned. This requires these supporting changes: - C string metadata symbols are still live even when buried in a SymExpr. - "Hypothetical" C string lengths, to represent a value that /will/ be passed to setCStringLength() if all goes well. (The idea is to allow for temporary constrainable symbols that may end up becoming permanent.) - The 'checkAdditionOverflow' helper makes sure that the two strings being appended in a strcat don't overflow size_t. This should never *actually* happen; the real effect is to keep the final string length from "wrapping around" in the constraint manager. This doesn't actually test the "bounded" operations (strncpy and strncat) because they can leave strings unterminated. Next on the list! llvm-svn: 133046
-
Jordy Rose authored
[analyzer] If a C string length is UnknownVal, clear any existing length binding. No tests yet because the only thing that sets string length is strcpy(), and that needs some work anyway. llvm-svn: 133044
-
- Jun 14, 2011
-
-
Jordy Rose authored
[analyzer] CStringChecker checks functions in the C standard library, not C++. Its external name is now unix.experimental.CString. llvm-svn: 132958
-
Jordy Rose authored
llvm-svn: 132956
-
Jordy Rose authored
[analyzer] Fix modeling of strnlen to be more conservative. Move tests we can't properly model (yet?) to string-fail.c. llvm-svn: 132955
-
- Jun 04, 2011
-
-
Jordy Rose authored
llvm-svn: 132618
-
Jordy Rose authored
[analyzer] Don't crash when copying an unknown number of bytes with memcpy(). Also handle all memcpy-family return values in evalCopyCommon(), rather than having some outside and some inside. llvm-svn: 132617
-
Jordy Rose authored
llvm-svn: 132614
-
Jordy Rose authored
llvm-svn: 132608
-
Jordy Rose authored
llvm-svn: 132607
-
Jordy Rose authored
llvm-svn: 132605
-
- May 06, 2011
-
-
Alexis Hunt authored
- New isDefined() function checks for deletedness - isThisDeclarationADefinition checks for deletedness - New doesThisDeclarationHaveABody() does what isThisDeclarationADefinition() used to do - The IsDeleted bit is not propagated across redeclarations - isDeleted() now checks the canoncial declaration - New isDeletedAsWritten() does what it says on the tin. - isUserProvided() now correct (thanks Richard!) This fixes the bug that we weren't catching void foo() = delete; void foo() {} as being a redefinition. llvm-svn: 131013
-
- May 03, 2011
-
-
Lenny Maiorani authored
Removing strncpy() checking in CString checker for now. Some significant changes need to be made to properly support modeling of it since it potentially leaves strings non-null terminated. llvm-svn: 130758
-
- May 02, 2011
-
-
Ted Kremenek authored
Augment retain/release checker to not warn about tracked objects passed as arguments to C++ constructors. This is a stop-gap measure for Objective-C++ code that uses smart pointers to manage reference counts. llvm-svn: 130711
-
Lenny Maiorani authored
Implements strncasecmp() checker and simplifies some of the logic around creating substrings if necessary and calling the appropriate StringRef::compare/compare_lower(). llvm-svn: 130708
-
- Apr 30, 2011
-
-
Ted Kremenek authored
llvm-svn: 130598
-
- Apr 28, 2011
-
-
Lenny Maiorani authored
Use StringRef::substr() and unbounded StringRef::compare() instead of bounded version of StringRef::compare() because bounded version of StringRef::compare() is going to be removed. llvm-svn: 130425
-
Lenny Maiorani authored
Eliminates an assert in the strncpy/strncat checker caused by not validating a cast was successful. If the value of an argument was unknown, the cast would result in a NULL pointer which was later being dereferenced. This fixes Bugzilla #9806. llvm-svn: 130422
-
Lenny Maiorani authored
llvm-svn: 130398
-
- Apr 27, 2011
-
-
Lenny Maiorani authored
More accurately model realloc() when the size argument is 0. realloc() with a size of 0 is equivalent to free(). The memory region should be marked as free and not used again. Unit tests f2_realloc_0(), f6_realloc(), and f7_realloc() contributed by Marshall Clow <mclow.lists@gmail.com>. Thanks! llvm-svn: 130303
-
Ted Kremenek authored
Allow 'Environment::getSVal()' to allow an optional way for checkers to do a direct lookup to values bound to expressions, without resulting to lazy logic. This is critical for the OSAtomicChecker that does a simulated load on any arbitrary expression. llvm-svn: 130292
-
- Apr 26, 2011
-
-
Lenny Maiorani authored
Implements the strncmp() checker just like the strcmp() checker, but with bounds. Requires LLVM svn r129582. llvm-svn: 130161
-