Commit Graph

12 Commits

Author SHA1 Message Date
Artem Dergachev b0914e7276 [analyzer] Specify the C++ standard in more tests.
Makes life easier for downstream developers with different default standard.

llvm-svn: 375308
2019-10-19 00:08:17 +00:00
Gabor Horvath c1dafd7b53 More warnings regarding gsl::Pointer and gsl::Owner attributes
Differential Revision: https://reviews.llvm.org/D65120

llvm-svn: 368446
2019-08-09 15:16:35 +00:00
Csaba Dabis 2e896b8b39 [analyzer] ConditionBRVisitor: Boolean support
Summary: -

Reviewers: NoQ, george.karpenkov

Reviewed By: NoQ, george.karpenkov

Subscribers: cfe-commits, xazax.hun, baloghadamsoftware, szepet, a.sidorin,
             mikhail.ramalho, Szelethus, donat.nagy, dkrupp

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58207

llvm-svn: 362027
2019-05-29 20:34:29 +00:00
Kristof Umann 391b19c78a [analyzer] Put llvm.Conventions back in alpha
Interestingly, this many year old (when I last looked I remember 2010ish)
checker was committed without any tests, so I thought I'd implement them, but I
was shocked to see how I barely managed to get it working. The code is severely
outdated, I'm not even sure it has ever been used, so I'd propose to move it
back into alpha, and possibly even remove it.

Differential Revision: https://reviews.llvm.org/D53856

llvm-svn: 345990
2018-11-02 16:02:10 +00:00
George Karpenkov 33e5a15896 [analyzer] Associate diagnostics created in checkEndFunction with a return statement, if possible
If not possible, use the last line of the declaration, as before.

Differential Revision: https://reviews.llvm.org/D52326

llvm-svn: 342768
2018-09-21 20:36:41 +00:00
Artem Dergachev 73b38668ce [analyzer] InnerPointerChecker: Fix a segfault when checking symbolic strings.
Return value of dyn_cast_or_null should be checked before use.
Otherwise we may put a null pointer into the map as a key and eventually
crash in checkDeadSymbols.

Differential Revision: https://reviews.llvm.org/D51385

llvm-svn: 341092
2018-08-30 18:45:05 +00:00
Reka Kovacs bb2749a594 [analyzer] InnerPointerChecker: improve warning messages and notes.
Differential Revision: https://reviews.llvm.org/D49570

llvm-svn: 339489
2018-08-10 23:56:57 +00:00
Reka Kovacs bfd9cfdeeb [analyzer] Add test for a crash fixed in r338775.
Do not crash if a CXXRecordDecl cannot be obtained for an object.

Special thanks for the reproduction to Alexander Kornienko.

llvm-svn: 338918
2018-08-03 20:42:02 +00:00
Reka Kovacs 122171e235 [analyzer] Detect pointers escaped after ReturnStmt execution in MallocChecker.
Objects local to a function are destroyed right after the statement returning
(part of) them is executed in the analyzer. This patch enables MallocChecker to
warn in these cases.

Differential Revision: https://reviews.llvm.org/D49361

llvm-svn: 338780
2018-08-02 23:02:08 +00:00
Reka Kovacs bb1078ad85 [analyzer] Move InnerPointerChecker out of alpha.
Differential Revision: https://reviews.llvm.org/D49058

llvm-svn: 338433
2018-07-31 20:27:11 +00:00
Reka Kovacs c74cfc4215 [analyzer] Add support for more invalidating functions in InnerPointerChecker.
According to the standard, pointers referring to the elements of a
`basic_string` may be invalidated if they are used as an argument to
any standard library function taking a reference to non-const
`basic_string` as an argument. This patch makes InnerPointerChecker warn
for these cases.

Differential Revision: https://reviews.llvm.org/D49656

llvm-svn: 338259
2018-07-30 15:43:45 +00:00
Reka Kovacs 88ad704b5b [analyzer] Rename DanglingInternalBufferChecker to InnerPointerChecker.
Differential Revision: https://reviews.llvm.org/D49553

llvm-svn: 337559
2018-07-20 15:14:49 +00:00