[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-29 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 456268. tomasz-kaminski-sonarsource added a comment. - Pass BldrCtx to handleConstructionContext Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132030/new/ https://reviews.llvm.org/D132030 F

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-29 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:753 -SVal V = computeObjectUnderConstruction(E, State, LCtx, CC, CallOpts, Idx);

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-09-13 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 459666. tomasz-kaminski-sonarsource added a comment. Ping and reformat. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132030/new/ https://reviews.llvm.org/D132030 Files: clang/include/cla

[PATCH] D124658: CSA Normalize SymIntExpr so the RHS is positive when possible

2022-04-29 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. tomasz-kaminski-sonarsource added reviewers: vsavchenko, NoQ, steakhal. Herald added a subscriber: martong. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this revision. Herald added a project: clang. Herald added a su

[PATCH] D124658: CSA Normalize SymIntExpr so the RHS is positive when possible

2022-04-29 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Without the changes, out of the following unsatisfiable conditions: A) `(l - 1000) > 0` B) `l > 1000` C) `l > 1000L` D) `(l + 0L) > 1000` CSA was considering A and B to satisable. The `l` is `(long)(x + 1 - 10U)` and `x` is in range `[10, 100]` so no o

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-04-29 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked 2 inline comments as done. tomasz-kaminski-sonarsource added a comment. > Could you please elaborate on this? I understand that you'd like to simplify > certain binary operations by merging the RHS and the operand, however, I > don't see what are the empirical

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-04-29 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 426056. tomasz-kaminski-sonarsource added a comment. Uploading updated diff with suggested fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:204 +// subtraction/addition of the negated value. +if (!RHS.isNegative()) { + ConvertedRHS = &BasicVals.Convert(resultTy, RHS); steakh

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 426999. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp clang/test/Analysis/additive-op-on-sym-int-expr.c clang/test/Analy

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 427001. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp clang/test/Analysis/additive-op-on-sym-int-expr.c clang/test/Analy

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-05 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 427245. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp clang/test/Analysis/additive-op-on-sym-int-expr.c clang/test/Analy

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-05 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. I do not have commit rights. Would it be possible to you to commit the changes on my behalf? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 ___ cfe-comm

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-06 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. I am looking into the crashes. The simplest solution is to not apply normalization in such a situation, and I am slowly converting to that solution. But, want to understand better how such values are produced in the first case, and if performing norm

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-06 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 427693. tomasz-kaminski-sonarsource added a comment. I have removed the assertions and updated the code to handle both extensions of reductions of bitwith from RHS to ResultType. Expanded test, to cover the above scenarios. CHANGES SINCE

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-06 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 427695. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp clang/test/Analysis/additive-op-on-sym-int-expr.c Index: clang/test

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-06 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 427717. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp clang/test/Analysis/additive-op-on-sym-int-expr.c Index: clang/test

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-06 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Added missing casts in `truncatingToUnsigned` tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-08 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 427982. tomasz-kaminski-sonarsource added a comment. Updated patch to match master after revert. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/S

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-09 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 427993. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp clang/test/Analysis/additive-op-on-sym-int-expr.c Index: clang/test

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-09 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 427999. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp clang/test/Analysis/additive-op-on-sym-int-expr.c Index: clang/test

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-09 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 428003. tomasz-kaminski-sonarsource added a comment. Updated and manually validated the patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/Sim

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-09 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 428011. tomasz-kaminski-sonarsource added a comment. Firstly, my apologies for the back and forth. My repo was in some strange state, and I wasn't picking up all the changes that got reverted in my patch (this is why the patch was not app

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-09 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 428030. tomasz-kaminski-sonarsource added a comment. Applied clang-format CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-09 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 428052. tomasz-kaminski-sonarsource added a comment. Changed variable name and formatting to match coding style. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://reviews.llvm.org/D124658 Files: clang/lib/Stati

[PATCH] D124845: StaticAnalyzer should inline overridden delete operator the same way as overridden new operator

2022-05-09 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1ec1cdcfb49a: [analyzer] Inline operator delete when MayInlineCXXAllocator is set. (authored by frederic-tingaud-sonarsource, committed by tomasz-ka

[PATCH] D124658: [analyzer] Canonicalize SymIntExpr so the RHS is positive when possible

2022-05-12 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Thank you for additional checks. Unfortunatelly, I am not able to perform commits for this and next wee (up to 20th of May), so I wonder if you could commit this one for me. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124658/new/ https://

[PATCH] D102835: [analyzer] Correctly propagate ConstructionContextLayer thru ParenExpr

2021-05-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. tomasz-kaminski-sonarsource added a reviewer: dcoughlin. Herald added subscribers: manas, steakhal, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. tomasz-kaminski-sonarsource reques

[PATCH] D102835: [analyzer] Correctly propagate ConstructionContextLayer thru ParenExpr

2021-05-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 346683. tomasz-kaminski-sonarsource added a comment. Added // no warn comment to line that was raising warning before the fix. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102835/new/ https://reviews.llvm.org/D102835 Files: c

[PATCH] D102835: [analyzer] Correctly propagate ConstructionContextLayer thru ParenExpr

2021-05-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/NewDelete-checker-test.cpp:54-57 +// RUN: %clang_analyze_cc1 -std=c++17 -fblocks -verify %s \ +// RUN: -verify=expected,leak \ +// RUN: -analyzer-checker=core \ +// RUN: -analyzer-checker=cpl

[PATCH] D102835: [analyzer] Correctly propagate ConstructionContextLayer thru ParenExpr

2021-05-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 346700. tomasz-kaminski-sonarsource added a comment. Removed duplicated runs that were only differing by specifying c++-allocator-inlinging=true, which is the default value. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102835/ne

[PATCH] D102835: [analyzer] Correctly propagate ConstructionContextLayer thru ParenExpr

2021-05-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/NewDelete-checker-test.cpp:41-52 +// RUN: %clang_analyze_cc1 -std=c++17 -fblocks %s \ +// RUN: -verify=expected,newdelete \ +// RUN: -analyzer-checker=core \ +// RUN: -analyzer-checker=cplusp

[PATCH] D102835: [analyzer] Correctly propagate ConstructionContextLayer thru ParenExpr

2021-05-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 346707. tomasz-kaminski-sonarsource added a comment. Adjusted Clang.Analysis::NewDelete-path-notes.cpp.plist for removed lines. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102835/new/ https://reviews.llvm.org/D102835 Files:

[PATCH] D102835: [analyzer] Correctly propagate ConstructionContextLayer thru ParenExpr

2021-05-21 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. I do not have commit rights. If there are no additional changes needed, would it be possible to you to commit the changes on my behalf? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102835/new/ https://reviews.llvm.org/D102835 _

[PATCH] D103025: [analyzer] Handle NTTP invocation in CallContext.getCalleeDecl()

2021-05-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. tomasz-kaminski-sonarsource added reviewers: NoQ, vsavchenko, steakhal. Herald added subscribers: manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. tomasz-kaminski-sona

[PATCH] D103025: [analyzer] Handle NTTP invocation in CallContext.getCalleeDecl()

2021-05-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. The alternative solution, that I think may be preferable is to remove following functions from CheckerContext and use CallEvent.getDecl() instead: const FunctionDecl *getCalleeDecl(const CallExpr *CE) const; StringRef getCalleeName(const FunctionD

[PATCH] D103025: [analyzer] Handle NTTP invocation in CallContext.getCalleeDecl()

2021-06-01 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Ping, Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103025/new/ https://reviews.llvm.org/D103025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[PATCH] D103025: [analyzer] Handle NTTP invocation in CallContext.getCalleeDecl()

2021-06-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Any input on the change? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103025/new/ https://reviews.llvm.org/D103025 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D103025: [analyzer] Handle NTTP invocation in CallContext.getCalleeDecl()

2021-06-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Would it be possible to merge it for me, as I do not have a commit right? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103025/new/ https://reviews.llvm.org/D103025 _

[PATCH] D103025: [analyzer] Handle NTTP invocation in CallContext.getCalleeDecl()

2021-06-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. For the author information use: Tomasz Kamiński tomasz.kamin...@sonarsource.com Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103025/new/ https://reviews.llvm.org/D103025 ___

[PATCH] D134947: [analyzer] Fix the liveness of Symbols for values in regions referred by LazyCompoundVal

2022-10-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa6b42040ad30: [analyzer] Fix the liveness of Symbols for values in regions referred by… (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:

[PATCH] D135136: [analyzer] Make directly bounded LazyCompoundVal as lazily copied

2022-10-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6194229c6287: [analyzer] Make directly bounded LazyCompoundVal as lazily copied (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CallEvent.cpp:490 +// edge-cases. +ArgVal = castArgToParamTypeIfNeeded(Call, Idx, ArgVal, SVB); + Previously we didng make bindings if `ArgVal` was unknown, and w

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/region-store.c:66 + // expected-warning@+1 {{passing arguments to 'b' without a prototype is deprecated in all versions of C and is not supported in C2x}} + b(&buffer); +} tomas

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-10-25 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. tomasz-kaminski-sonars

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-10-25 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. In D136671#3882166 , @isuckatcs wrote: >> This eliminate the crash in `getDynamicElementCount` on that region > > I think that if the crash comes from `getDynamicElementCount`, we should > address it there too

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-10-25 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 470489. tomasz-kaminski-sonarsource added a comment. Added assertion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136671/new/ https://reviews.llvm.org/D136671 Files: clang/lib/StaticAna

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. tomasz-kaminski-sonars

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 453334. tomasz-kaminski-sonarsource added a comment. Fixed formatting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132030/new/ https://reviews.llvm.org/D132030 Files: clang/include/clan

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:753 -SVal V = computeObjectUnderConstruction(E, State, LCtx, CC, CallOpts, Idx); +SVal V = computeObjectUnderConstruction(E, State, currBld

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:753 -SVal V = computeObjectUnderConstruction(E, State, LCtx, CC, CallOpts, Idx); +SVal V = computeObjectUnderConstruction(E, State, currBld

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. @NoQ Do you agree with my view on `handleConstructionContext`, if so is the issue ready to land? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132030/new/ https://reviews.llvm.org/D132030 _

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-26 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132030/new/ https://reviews.llvm.org/D132030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-09-26 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4ff836a138b4: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-09-30 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: manas, steakhal, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this revision.

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-09-30 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464184. tomasz-kaminski-sonarsource added a comment. Added new line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134941/new/ https://reviews.llvm.org/D134941 Files: clang/test/Analysis/N

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-09-30 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. tomasz-kaminski-sonars

[PATCH] D132236: [analyzer] Fix liveness of LazyCompoundVals

2022-09-30 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. > What looks fishy about getInterestingValues() is that it assumes that the > amount of interesting values is finite. This sounds incredibly wrong to me. > If a lazy compound value contains any pointer symbol `$p`, then all values in > the following

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464657. tomasz-kaminski-sonarsource added a comment. Added requested comment for the example. Included additional false-positive test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134941/new

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked 2 inline comments as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/symbol-reaper-lambda.cpp:14 +escape(param, local_pre_lambda); +return ref_captured; // no-warning: The value is not garbage. +

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464659. tomasz-kaminski-sonarsource added a comment. Included additional tests that corresponds to TODO. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134947/new/ https://reviews.llvm.org/D1

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. tomasz-kaminski-sonarsource marked an inline comment as done. Closed by commit rG73716baa30eb: [analyzer][NFC] Add tests for D132236 (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464673. tomasz-kaminski-sonarsource marked 3 inline comments as done. tomasz-kaminski-sonarsource added a comment. Applied review suggestions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D13

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Applied all review suggestions. Comment at: clang/lib/StaticAnalyzer/Core/SymbolManager.cpp:461 +bool SymbolReaper::isLazilyCopiedRegion(const MemRegion *MR) const { + // TODO: See comment in isLiveRegion. + return LazilyCopiedRegi

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464677. tomasz-kaminski-sonarsource added a comment. Herald added subscribers: openmp-commits, zero9178, bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, mravishankar, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1,

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464678. tomasz-kaminski-sonarsource added a comment. Fighting with arcanist. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134947/new/ https://reviews.llvm.org/D134947 Files: clang/includ

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464684. tomasz-kaminski-sonarsource added a comment. Applied suggested comment updates. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134947/new/ https://reviews.llvm.org/D134947 Files: c

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/trivial-copy-struct.cpp:98 + // w->head.next and n->next are equal + clang_analyzer_warnIfReached(); // expected-warning {{REACHABLE}} +} NoQ wrote: > martong wrote:

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-06 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked 2 inline comments as done. tomasz-kaminski-sonarsource added a comment. Where should I add As a result of our internal test on around ~170 projects (~20 Widnows, ~150 Linux) that are compromised of several hundreds of millions of lines of code, the impact on th

[PATCH] D134947: [analyzer] Fix the liveness of Symbols for values in regions referred by LazyCompoundVal

2022-10-06 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SymbolManager.cpp:461 +bool SymbolReaper::isLazilyCopiedRegion(const MemRegion *MR) const { + // TODO: See comment in isLive

[PATCH] D135136: [analyzer] Make directly bounded LazyCompoundVal as lazily copied

2022-10-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:2843 -// subregions of the `LCS.getRegion()` also lazily copied. -if (const MemRegion *R = LCS->getRegion()) - SymReaper.markLazilyCopied(R);

[PATCH] D140891: [analyzer] Fix assertion failure in SMT conversion for unary operator on floats.

2023-01-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. tomasz-kaminski-sonarsource requ

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-11-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 473166. tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added a comment. Added assert Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136671/new/ http

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-11-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:1244 SVal *ElementCountVal) { + assert(Region != nullptr && "Null-regions passed to prepareStateForArrayDestruction."); ---

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-11-09 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2fb3bec932ed: [analyzer] Fix crash for array-delete of UnknownVal values. (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D153273: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements

2023-07-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd937836ead34: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements (authored by tomasz-kaminski-sonarsource). Repository:

[PATCH] D155547: CPP-4580 Model lifetime of a variable declared in for condition in CFG correctly

2023-07-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added a reviewer: NoQ. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Per [stmt.for] p1 (https://eel.is/c++draft/stmt.for#1)

[PATCH] D155442: [analyzer] Bind return value for assigment and copies of trivial empty classes

2023-07-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG61760bb98c46: [analyzer] Bind return value for assigment and copies of trivial empty classes (authored by tomasz-kaminski-sonarsource). Changed prio

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/lifetime-cfg-output.cpp:609 // CHECK-NEXT:1: [B9.2] (Lifetime ends) // CHECK-NEXT:T: continue; // CHECK-NEXT:Preds (1): B7 Note that the lifetime ends for `[B10.4]`/

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 541519. tomasz-kaminski-sonarsource added a comment. Updated unit tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155547/new/ https://reviews.llvm.org/D155547 Files: clang/lib/Analysi

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/auto-obj-dtors-cfg-output.cpp:1231 A a; - for (A b; A c = b; ) { + for (A b; A c = b; ++c.x) { A d; xazax.hun wrote: > Would there be any value in also keeping a couple o

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:3511 // go in this block as well. Block = Succ = TransitionBlock = createBlock(false); TransitionBlock->setLoopTa

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc3dd2f35b876: [analyzer] Model lifetime of a variable declared in for condition in CFG… (authored by tomasz-kaminski-sonarsource). Repository: rG

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/lifetime-cfg-output.cpp:1 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-lifetime=true,cfg-temporary-dtors=false,cfg-rich-construc

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: manas, steakhal, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this revision.

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Updating this tests illustrated that we are missing a lot of coverage for the objects with trivial destructors, but I think this should be addressed as a separate patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked 2 inline comments as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/lifetime-cfg-output.cpp:1 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-checker=debug.DumpCFG -analyzer-config

[PATCH] D155847: [analyzer] Fix crash in GenericTaintChecker when propagatig taint to AllocaRegion

2023-07-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. tomasz-kaminski-sonars

[PATCH] D155847: [analyzer] Fix crash in GenericTaintChecker when propagatig taint to AllocaRegion

2023-07-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. I belive this fix to be the correct approach, as it reduces the number of edge cases to deal with. We are using it on internal fork for over a year know, and haven't found any negative impact. Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-21 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 542779. tomasz-kaminski-sonarsource added a comment. Added generic FIXME comment for covering test cases for types with trivial destructor. This affects nearly all tests cases from file, so some tought needs to be put on how to apporach i

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 543407. tomasz-kaminski-sonarsource added a comment. Updated text of FIXME Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155694/new/ https://reviews.llvm.org/D155694 Files: clang/test/Ana

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/lifetime-cfg-output.cpp:6 +// that has non-trivial destructor. As the behavior for such types is different +// from ones with trivial d

[PATCH] D155847: [analyzer] Fix crash in GenericTaintChecker when propagatig taint to AllocaRegion

2023-07-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG438fc2c83b73: [analyzer] Fix crash in GenericTaintChecker when propagatig taint to… (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. tomasz-kaminski-sonarsource marked an inline comment as done. Closed by commit rG587b8f323d2d: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests (author

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:1282 + LLVM_ATTRIBUTE_RETURNS_NONNULL + const Expr *getExpr() const { return Ex; } +

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added a comment. In D151325#4470832 , @xazax.hun wrote: > Overall looks good to me. I think the changes to the notes already make the > analyzer more useful so ther

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 537092. tomasz-kaminski-sonarsource added a comment. Reformatting and link to revelant core issue. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151325/new/ https://reviews.llvm.org/D151325

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp:556 + bool IsLocal = + isa_and_nonnull(MR) && + isa(MR->getMemorySpace()); xa

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. tomasz-kaminski-sonarsource marked an inline comment as done. Closed by commit rGfeafbb9fda57: [analyzer] Differentiate lifetime extended temporaries (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github M

[PATCH] D154827: [analyzer] NonParamVarRegion should prefer definition over canonical decl

2023-07-10 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource accepted this revision. tomasz-kaminski-sonarsource added a comment. This revision is now accepted and ready to land. Looks good. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154827/new/ https://reviews.llvm.org

[PATCH] D153273: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements

2023-07-12 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 539470. tomasz-kaminski-sonarsource marked 3 inline comments as done. tomasz-kaminski-sonarsource added a comment. Apply review suggestion and replaced make_scope_exit with SaveAndRestore that was already used in file. Repository: rG L

  1   2   >