martong added inline comments.
Comment at: clang/test/Analysis/unary-sym-expr.c:35
+return;
+ clang_analyzer_eval(-(x + y) == -3); // expected-warning{{TRUE}}
+}
steakhal wrote:
> martong wrote:
> > steakhal wrote:
> > > Does it work if you swap x and y?
> >
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
martong marked 2 inline comments as done.
Closed by commit rGb5b2aec1ff51: [analyzer] Add UnarySymExpr (authored by
martong).
Changed prior to commit:
https://review
steakhal accepted this revision.
steakhal added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/test/Analysis/unary-sym-expr.c:35
+return;
+ clang_analyzer_eval(-(x + y) == -3); // expected-warning{{TRUE}}
+}
martong wrote
martong marked 2 inline comments as done.
martong added inline comments.
Comment at: clang/test/Analysis/unary-sym-expr.c:35
+return;
+ clang_analyzer_eval(-(x + y) == -3); // expected-warning{{TRUE}}
+}
steakhal wrote:
> Does it work if you swap x and y?
No
martong updated this revision to Diff 429207.
martong added a comment.
- Revert "Add type parameter to evalMinus and evalComplement"
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125318/new/
https://reviews.llvm.org/D125318
Files:
clang/include/
martong added inline comments.
Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:107
+return makeNonLoc(X.castAs().getSymbol(), UO_Not,
+ X.getType(Context));
default:
steakhal wrote:
> martong wrote:
> > steakhal wrote:
steakhal added inline comments.
Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:107
+return makeNonLoc(X.castAs().getSymbol(), UO_Not,
+ X.getType(Context));
default:
martong wrote:
> steakhal wrote:
> > I'm not sure if
martong updated this revision to Diff 429152.
martong marked an inline comment as done.
martong added a comment.
- Add type parameter to evalMinus and evalComplement
- Correct dumpToStream in case of binary sub expressions
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https:
martong marked an inline comment as done.
martong added inline comments.
Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:107
+return makeNonLoc(X.castAs().getSymbol(), UO_Not,
+ X.getType(Context));
default:
steakhal wr
steakhal added inline comments.
Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:107
+return makeNonLoc(X.castAs().getSymbol(), UO_Not,
+ X.getType(Context));
default:
I'm not sure if we should rely on `SVal::getType()`.
martong updated this revision to Diff 428601.
martong marked 6 inline comments as done.
martong added a comment.
- Handle UnarySymExpr in SValExplainer
- Handle UnarySymExpr in SymbolExpressor
- Handle UnarySymExpr in SimpleSvalBuilder's Simplifier
- Better assertions
- Handle UO_Not
Repository:
martong marked 9 inline comments as done.
martong added a comment.
Thanks for the review guys!
> It feels like `SymbolCast` is a `UnarySymExpr`, but I like to have a distinct
> entity for this.
Yes, their implementation is similar, but there are subtle differences.
> Anyway. There are a lot mo
NoQ added a comment.
Looks great!
I suspect you'll catch a few crashes/assertion failures if you run this on
real-world code, due to various parts of the static analyzer being startled by
the new thing, so I really recommend doing this.
Comment at:
clang/include/clang/Stati
steakhal requested changes to this revision.
steakhal added a comment.
This revision now requires changes to proceed.
Looks great. It'll be a nice addition.
It feels like `SymbolCast` is a `UnarySymExpr`, but I like to have a distinct
entity for this.
Anyway. There are a lot more places where w
martong added a comment.
Related false positive: https://github.com/llvm/llvm-project/issues/55241
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125318/new/
https://reviews.llvm.org/D125318
___
cfe-commi
martong created this revision.
martong added reviewers: NoQ, steakhal.
Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy,
Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware,
xazax.hun.
Herald added a reviewer: Szelethus.
Herald added a project:
16 matches
Mail list logo