r.stahl added a comment.
In https://reviews.llvm.org/D45774#1088453, @NoQ wrote:
> Two questions for the future:
>
> - Should we skip the initializer binding for local variables (and
> fields/elements of local variables) entirely? Cause we can load from them
> anyway. And keeping the Store smal
xazax.hun added inline comments.
Comment at: lib/StaticAnalyzer/Core/RegionStore.cpp:1642-1645
+// Return unknown value if index is out of bounds.
+if (i < 0 || i >= InitList->getNumInits()) {
+ return UnknownVal();
+}
This revision was automatically updated to reflect the committed changes.
Closed by commit rC331556: [analyzer] Treat more const variables and fields as
known contants. (authored by dergachev, committed by ).
Repository:
rC Clang
https://reviews.llvm.org/D45774
Files:
lib/StaticAnalyzer/Cor
NoQ added a comment.
Two questions for the future:
- Should we skip the initializer binding for local variables (and
fields/elements of local variables) entirely? Cause we can load from them
anyway. And keeping the Store small might be good for performance.
- Just in case, do you accidentally
NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.
Yup, thanks! I'll commit.
https://reviews.llvm.org/D45774
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman
r.stahl added inline comments.
Comment at: lib/StaticAnalyzer/Core/RegionStore.cpp:1723
+if (const InitListExpr *InitList = dyn_cast(Init)) {
+ if (const Expr *FieldInit = InitList->getInit(FD->getFieldIndex())) {
+if (Optional V = svalBuilder.getCons
r.stahl updated this revision to Diff 145156.
r.stahl marked 3 inline comments as done.
r.stahl added a comment.
addressed the comments, thanks!
If it looks good, please commit for me.
https://reviews.llvm.org/D45774
Files:
lib/StaticAnalyzer/Core/RegionStore.cpp
lib/StaticAnalyzer/Core/SV
george.karpenkov added inline comments.
Comment at: lib/StaticAnalyzer/Core/RegionStore.cpp:1720
+// Either the record variable or the field has to be const qualified.
+if (RecordVarTy.isConstQualified() || Ty.isConstQualified()) {
+ if (const Expr *Init = VD->getIni
NoQ added a comment.
Looks great, thanks!
> CXXDynamicCastExpr: I don't think evalCast would handle this correctly, does
> it?
Seems so. It is partially supported by `StoreManager::attemptDownCast()`. I
also see relatively little urgency in handling it here because the whole point
of `dynamic
MTC added a comment.
Test files for `initialization` missing? : )
Repository:
rC Clang
https://reviews.llvm.org/D45774
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r.stahl added a comment.
Not sure how to proceed about these:
- CXXDynamicCastExpr: I don't think evalCast would handle this correctly, does
it?
- ObjCBridgedCastExpr: I don't know ObjectiveC
- CastKinds for floating point: Floats cannot yet be handled by the analyzer,
right?
Repository:
rC
r.stahl created this revision.
r.stahl added reviewers: NoQ, dcoughlin, xazax.hun.
Herald added subscribers: cfe-commits, a.sidorin, rnkovacs, szepet, mehdi_amini.
Herald added a reviewer: george.karpenkov.
- SValBuilder::getConstantVal stopped processing an initialization if there are
intermedia
12 matches
Mail list logo