[PATCH] D27599: [analyzer] Teach the analyzer that pointers can escape into __cxa_demangle

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna created this revision. zaks.anna added a reviewer: dergachev.a. zaks.anna added subscribers: dcoughlin, cfe-commits. This fixes a reported false positive in the malloc checker. https://reviews.llvm.org/D27599 Files: lib/StaticAnalyzer/Core/CallEvent.cpp test/Analysis/Inputs/system

[PATCH] D27600: [analyzer] Refine the diagnostics in the nullability checker to differentiate between nil and null

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna created this revision. zaks.anna added a reviewer: dcoughlin. zaks.anna added subscribers: dergachev.a, cfe-commits. This is a big deal for ObjC, where nullability annotations are extensively used. I've also changed "Null" -> "null" and removed "is" as this is the pattern that Sema is

[PATCH] D27600: [analyzer] Refine the diagnostics in the nullability checker to differentiate between nil and null

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. Looks like Sema uses "null" not only when referring to literals (see below). Also, if we were referring to literals, we would use single quotes, no? I suggest keeping as is for consistency with the wording that uses nil. I do not see much difference between the two ca

[PATCH] D25660: [Analyzer] Checker for iterators dereferenced beyond their range.

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. Thanks Artem! Just to be clear, I think this patch should be committed once "inTopLevelNamespace" issue is addressed. That is the only issue pending as far as I can see. The visitor should be a separate patch. https://reviews.llvm.org/D25660

[PATCH] D27607: [ubsan] Treat ObjC's BOOL as if its range is always {0, 1}

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:1222 +/// modes, it's safe to treat such a type as 'the builtin bool'. +static bool isObjCBool(QualType Ty, const SourceManager &SM, + const LangOptions &LO) { Could you use

[PATCH] D27600: [analyzer] Refine the diagnostics in the nullability checker to differentiate between nil and null

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna updated this revision to Diff 80925. zaks.anna added a comment. Updated "null"-> "Null" as per Devin's suggestion. https://reviews.llvm.org/D27600 Files: lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp test/Analysis/nullability-no-arc.mm test/Analysis/nullability.mm test/An

[PATCH] D27607: [ubsan] Treat ObjC's BOOL as if its range is always {0, 1}

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna accepted this revision. zaks.anna added a reviewer: zaks.anna. zaks.anna added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D27607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:/

[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added inline comments. Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:494 +def ObjCPropertyChecker : Checker<"ObjCProperty">, + HelpText<"Find various issues with Objective-C properties">, + DescFile<"ObjCPropertyChecker.cpp">; Nit: may

[PATCH] D27202: [analyzer] Do not conjure a symbol for return value of a conservatively evaluated function

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. > Could you please remove the IteratorPastEndChecker file differences from this > patch and make https://reviews.llvm.org/D25660 > dependent on this one? Since this has not been reviewed yet while the IteratorPastEndChecker has been, I do not think we should block t

[PATCH] D27091: Add the way to extract SVals of arguments used in a call for a given StackFrameCtx

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. Update: Adding support for top frame to the CallEvent is difficult, so let's just use CallEvent API in the checkers for all frames but the top one and have custom top frame handling in the Recursion checker itself. The top frame handling does not need to be complete (

[PATCH] D26691: [analyzer] Run clang-format and fix style

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna accepted this revision. zaks.anna added a comment. This revision is now accepted and ready to land. Thank you! Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:459 // Notice that the lower bound is greater than the upper bound. - RangeSet New = GetRa

[PATCH] D27726: [analyzer] Refer to macro names in diagnostics for macros representing a literal

2016-12-13 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna created this revision. zaks.anna added reviewers: dergachev.a, dcoughlin. zaks.anna added a subscriber: cfe-commits. When a macro expending to a literal is used in a comparison, use the macro name in the diagnostic rather than the literal. This improves readability of path notes. Adde

[PATCH] D27740: [analyzer] Include type name in Retain Count Checker diagnostics

2016-12-13 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna created this revision. zaks.anna added a reviewer: dcoughlin. zaks.anna added subscribers: cfe-commits, dcoughlin. The more detailed diagnostic will make identifying which object the diagnostics refer to easier. https://reviews.llvm.org/D27740 Files: lib/StaticAnalyzer/Checkers/Ret

[PATCH] D31975: [Analyzer] Iterator Checkers

2017-04-19 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. @baloghadamsoftware Thanks for working on this! However, this patch is getting too big. Could you, please, split it into incremental patches so that it would be easier to review? More motivation of why this is very important is here http://llvm.org/docs/DeveloperPol

[PATCH] D30691: [analyzer] Support for naive cross translational unit analysis

2017-04-19 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. I agree that scan-build or scan-build-py integration is an important issue to resolve here. What I envision is that users will just call scan-build and pass -whole-project as an option to it. Everything else will happen automagically:) Another concern is dumping the A

[PATCH] D32328: [analyzer] Fix assert in ExprEngine::processSwitch

2017-04-20 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna accepted this revision. zaks.anna added a comment. This revision is now accepted and ready to land. Thank you! Repository: rL LLVM https://reviews.llvm.org/D32328 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm

[PATCH] D32328: [analyzer] Fix assert in ExprEngine::processSwitch

2017-04-20 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. Do you have commit access? Repository: rL LLVM https://reviews.llvm.org/D32328 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32291: [analyzer] Implement handling array subscript into null pointer, improve null dereference checks for array subscripts

2017-04-28 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added inline comments. Comment at: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:80 } -else if (isDeclRefExprToReference(E)) { +else if (isa(E)) { return E; Not sure what this does, but looks like we are stricter here now

[PATCH] D32702: [analyzer] Fix 'Memory Error' bugtype capitalization.

2017-05-01 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna accepted this revision. zaks.anna added a comment. Thanks! https://reviews.llvm.org/D32702 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32437: [analyzer] Nullability: fix a crash when adding notes inside a synthesized property accessor.

2017-05-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna accepted this revision. zaks.anna added a comment. This revision is now accepted and ready to land. > These new "extra notes" of mine might be useful (we could put them at > property declaration), i could add them if everybody likes this idea. What are these? Is there a PR? It would b

[PATCH] D31029: [analyzer] Fix logical not for pointers with different bit width

2017-05-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. Sorry for the delay!!! Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h:180 + inline const llvm::APSInt &getZeroWithTypeSize(QualType T, + bool isUnsigned = true) { +

[PATCH] D32437: [analyzer] Nullability: fix a crash when adding notes inside a synthesized property accessor.

2017-05-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. > That wouldn't work this way because we'd have the completely redundant > "calling property accessor" piece before that, and "returning..." after that. I think we should not print "calling" and "returning" for calling into and returning from autogenerated code, If we

[PATCH] D32449: Modifying PthreadLockChecker.cpp to reduce false positives.

2017-05-10 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. Thank you for the patch! Could you please re-submit the patch with context? Instructions on how to do that can be found here: http://llvm.org/docs/Phabricator.html Repository: rL LLVM https://reviews.llvm.org/D32449 __

[PATCH] D33263: [scan-build] Patch to scan-build tool to support "--target=" flag

2017-05-16 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna accepted this revision. zaks.anna added a comment. This revision is now accepted and ready to land. Looks good. Thank you! Do you have commit access or should we commit? https://reviews.llvm.org/D33263 ___ cfe-commits mailing list cfe-com

[PATCH] D33191: [analyzer] ObjCGenerics: account for __kindof specifiers met along a chain of casts.

2017-05-17 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added inline comments. Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:464 ASTContext &C) { + if (hasKindofArgs(StaticUpperBound)) { +// If the upper bound type has more __kindof specs, we drop all the info,

[PATCH] D32437: [analyzer] Nullability: fix a crash when adding notes inside a synthesized property accessor.

2017-05-17 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment. Thanks! A couple of minor comments below. Comment at: lib/StaticAnalyzer/Core/PathDiagnostic.cpp:699 + // We cannot place diagnostics on autosynthesized code. + // Put them onto the call site through which we jumped into autosynthesized + // code f

<    1   2   3   4   5   6