History log of /llvm-project/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp (Results 101 – 125 of 208)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 742fd989 31-Aug-2015 Gabor Horvath <xazax.hun@gmail.com>

Revert r246345 until an assertion is fixed.

llvm-svn: 246479


# 35d5dd29 28-Aug-2015 Devin Coughlin <dcoughlin@apple.com>

[analyzer] When memcpy'ing into a fixed-size array, do not invalidate entire region.

Change the analyzer's modeling of memcpy to be more precise when copying into fixed-size
array fields. With this

[analyzer] When memcpy'ing into a fixed-size array, do not invalidate entire region.

Change the analyzer's modeling of memcpy to be more precise when copying into fixed-size
array fields. With this change, instead of invalidating the entire containing region the
analyzer now invalidates only offsets for the array itself when it can show that the
memcpy stays within the bounds of the array.

This addresses false positive memory leak warnings of the kind reported by
krzysztof in https://llvm.org/bugs/show_bug.cgi?id=22954

A patch by Pierre Gousseau!

Differential Revision: http://reviews.llvm.org/D11832

llvm-svn: 246345

show more ...


Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1
# 8d3a7a56 23-Jun-2015 Aaron Ballman <aaron@aaronballman.com>

Clarify pointer ownership semantics by hoisting the std::unique_ptr creation to the caller instead of hiding it in emitReport. NFC.

llvm-svn: 240400


Revision tags: llvmorg-3.6.1, llvmorg-3.6.1-rc1
# 3dbaf853 17-Apr-2015 Sylvestre Ledru <sylvestre@debian.org>

Remove the assertion as it was useless and broken.

Enforcing the assert caused the following tests to fail:
Clang :: Analysis__bstring.c
Clang :: Analysis__comparison-implicit-casts.cpp
Clang :: Ana

Remove the assertion as it was useless and broken.

Enforcing the assert caused the following tests to fail:
Clang :: Analysis__bstring.c
Clang :: Analysis__comparison-implicit-casts.cpp
Clang :: Analysis__malloc-interprocedural.c
Clang :: Analysis__malloc.c
Clang :: Analysis__redefined_system.c
Clang :: Analysis__string.c
Clang :: Analysis__weak-functions.c

llvm-svn: 235190

show more ...


# 91ba4b1a 17-Apr-2015 Sylvestre Ledru <sylvestre@debian.org>

Fix a bad assert. Found by coverity. CID 1101110

llvm-svn: 235188


Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1, llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1
# 2d2f137e 03-Oct-2014 Anna Zaks <ganna@apple.com>

[analyzer] Make CStringChecker correctly calculate return value of mempcpy

The return value of mempcpy is only correct when the destination type is
one byte in size. This patch casts the argument to

[analyzer] Make CStringChecker correctly calculate return value of mempcpy

The return value of mempcpy is only correct when the destination type is
one byte in size. This patch casts the argument to a char* so the
calculation is also correct for structs, ints etc.

A patch by Daniel Fahlgren!

llvm-svn: 219024

show more ...


Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1
# 0dbb783c 27-May-2014 Craig Topper <craig.topper@gmail.com>

[C++11] Use 'nullptr'. StaticAnalyzer edition.

llvm-svn: 209642


Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1, llvmorg-3.4.1, llvmorg-3.4.1-rc2, llvmorg-3.4.1-rc1
# 535bbccc 14-Mar-2014 Aaron Ballman <aaron@aaronballman.com>

[C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with iterator_range decls(). Updating all of the usages of the iterators with range-based for loops.

llvm-svn: 203947


# b8984329 07-Mar-2014 Ahmed Charles <ahmedcharles@gmail.com>

Replace OwningPtr with std::unique_ptr.

This compiles cleanly with lldb/lld/clang-tools-extra/llvm.

llvm-svn: 203279


# 867ea1d4 02-Mar-2014 Benjamin Kramer <benny.kra@googlemail.com>

[C++11] Replace llvm::tie with std::tie.

llvm-svn: 202639


# 4aca9b1c 11-Feb-2014 Alexander Kornienko <alexfh@google.com>

Expose the name of the checker producing each diagnostic message.

Summary:
In clang-tidy we'd like to know the name of the checker producing each
diagnostic message. PathDiagnostic has BugType and C

Expose the name of the checker producing each diagnostic message.

Summary:
In clang-tidy we'd like to know the name of the checker producing each
diagnostic message. PathDiagnostic has BugType and Category fields, which are
both arbitrary human-readable strings, but we need to know the exact name of the
checker in the form that can be used in the CheckersControlList option to
enable/disable the specific checker.

This patch adds the CheckName field to the CheckerBase class, and sets it in
the CheckerManager::registerChecker() method, which gets them from the
CheckerRegistry.

Checkers that implement multiple checks have to store the names of each check
in the respective registerXXXChecker method.

Reviewers: jordan_rose, krememek

Reviewed By: jordan_rose

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2557

llvm-svn: 201186

show more ...


Revision tags: llvmorg-3.4.0, llvmorg-3.4.0-rc3, llvmorg-3.4.0-rc2, llvmorg-3.4.0-rc1
# 968c60a5 17-Nov-2013 Anton Yartsev <anton.yartsev@gmail.com>

[analyzer] Better modeling of memcpy by the CStringChecker (PR16731).

New rules of invalidation/escape of the source buffer of memcpy: the source buffer contents is invalidated and escape while the

[analyzer] Better modeling of memcpy by the CStringChecker (PR16731).

New rules of invalidation/escape of the source buffer of memcpy: the source buffer contents is invalidated and escape while the source buffer region itself is neither invalidated, nor escape.
In the current modeling of memcpy the information about allocation state of regions, accessible through the source buffer, is not copied to the destination buffer and we can not track the allocation state of those regions anymore. So we invalidate/escape the source buffer indirect regions in anticipation of their being invalidated for real later. This eliminates false-positive leaks reported by the unix.Malloc and alpha.cplusplus.NewDeleteLeaks checkers for the cases like

char *f() {
void *x = malloc(47);
char *a;
memcpy(&a, &x, sizeof a);
return a;
}

llvm-svn: 194953

show more ...


# 6feda287 04-Oct-2013 Jordan Rose <jordan_rose@apple.com>

[analyzer] Replace bug category magic strings with shared constants, take 2.

Re-commit r191910 (reverted in r191936) with layering violation fixed, by
moving the bug categories to StaticAnalyzerCore

[analyzer] Replace bug category magic strings with shared constants, take 2.

Re-commit r191910 (reverted in r191936) with layering violation fixed, by
moving the bug categories to StaticAnalyzerCore instead of ...Checkers.

llvm-svn: 191937

show more ...


# 25d8e737 03-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk>

Temporarily revert r191910 until the layering violation can be fixed.

llvm-svn: 191936


# 761ee868 03-Oct-2013 Jordan Rose <jordan_rose@apple.com>

[analyzer] Replace bug category magic strings with shared constants.

One small functionality change is to bring the sizeof-pointer checker in
line with the other checkers by making its category be "

[analyzer] Replace bug category magic strings with shared constants.

One small functionality change is to bring the sizeof-pointer checker in
line with the other checkers by making its category be "Logic error"
instead of just "Logic". There should be no other functionality changes.

Patch by Daniel Marjamäki!

llvm-svn: 191910

show more ...


# 60619a63 19-Aug-2013 Jordan Rose <jordan_rose@apple.com>

[analyzer] Assume that strings are no longer than SIZE_MAX/4.

This keeps the analyzer from making silly assumptions, like thinking
strlen(foo)+1 could wrap around to 0. This fixes PR16558.

Patch by

[analyzer] Assume that strings are no longer than SIZE_MAX/4.

This keeps the analyzer from making silly assumptions, like thinking
strlen(foo)+1 could wrap around to 0. This fixes PR16558.

Patch by Karthik Bhat!

llvm-svn: 188680

show more ...


Revision tags: llvmorg-3.3.1-rc1
# 7e18009a 12-Jun-2013 Pavel Labath <labath@google.com>

Fix memory corruption in CStringChecker

Summary:
"register" functions for the checker were caching the checker objects in a
static variable. This caused problems when the function is called with a
d

Fix memory corruption in CStringChecker

Summary:
"register" functions for the checker were caching the checker objects in a
static variable. This caused problems when the function is called with a
different CheckerManager.

Reviewers: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D955

llvm-svn: 183823

show more ...


Revision tags: llvmorg-3.3.0, llvmorg-3.3.0-rc3, llvmorg-3.3.0-rc2, llvmorg-3.3.0-rc1
# 6e3cf2ba 22-Apr-2013 Jordan Rose <jordan_rose@apple.com>

[analyzer] Model strsep(), particularly that it returns its input.

This handles the false positive leak warning in PR15374, and also serves
as a basic model for the strsep() function.

llvm-svn: 180

[analyzer] Model strsep(), particularly that it returns its input.

This handles the false positive leak warning in PR15374, and also serves
as a basic model for the strsep() function.

llvm-svn: 180069

show more ...


# 87396b9b 21-Feb-2013 David Blaikie <dblaikie@gmail.com>

Replace ProgramPoint llvm::cast support to be well-defined.

See r175462 for another example/more details.

llvm-svn: 175812


# 05785d16 20-Feb-2013 David Blaikie <dblaikie@gmail.com>

Include llvm::Optional in clang/Basic/LLVM.h

Post-commit CR feedback from Jordan Rose regarding r175594.

llvm-svn: 175679


# 2fdacbc5 20-Feb-2013 David Blaikie <dblaikie@gmail.com>

Replace SVal llvm::cast support to be well-defined.

See r175462 for another example/more details.

llvm-svn: 175594


# 4938f276 09-Feb-2013 Jordan Rose <jordan_rose@apple.com>

Remove some stray uses of <ctype.h> functions.

These are causing assertions on some MSVC builds.

llvm-svn: 174805


# 0c34c1a2 16-Jan-2013 Anna Zaks <ganna@apple.com>

[analyzer] Refactor: parameter rename.

llvm-svn: 172595


# 9747febb 21-Dec-2012 Anna Zaks <ganna@apple.com>

[analyzer] Address Jordan's nitpicks as per code review of r170625.

llvm-svn: 170832


Revision tags: llvmorg-3.2.0
# dc15415d 20-Dec-2012 Anna Zaks <ganna@apple.com>

[analyzer] Add the pointer escaped callback.

Instead of using several callbacks to identify the pointer escape event,
checkers now can register for the checkPointerEscape.

Converted the Malloc chec

[analyzer] Add the pointer escaped callback.

Instead of using several callbacks to identify the pointer escape event,
checkers now can register for the checkPointerEscape.

Converted the Malloc checker to use the new callback.
SimpleStreamChecker will be converted next.

llvm-svn: 170625

show more ...


123456789