This revision was automatically updated to reflect the committed changes.
Closed by commit rL289873: [analyzer] Add a new SVal to support
pointer-to-member operations. (authored by dcoughlin).
Changed prior to commit:
https://reviews.llvm.org/D25475?vs=81598&id=81655#toc
Repository:
rL LLVM
kromanenkov updated this revision to Diff 81598.
kromanenkov added a comment.
Fix issues pointed by @dcoughlin and rebase patch on master.
https://reviews.llvm.org/D25475
Files:
include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
include/clang/StaticAnalyzer/Core/PathSensiti
dcoughlin accepted this revision.
dcoughlin added a comment.
This revision is now accepted and ready to land.
Looks good to me, other than some super tiny nits! Thanks for iterating on this
-- it is awesome that the analyzer will be able to model this now!!
Comment at: include
kromanenkov updated this revision to Diff 81352.
kromanenkov added a comment.
Thanks for your comments, Devin! You were right about the list of path
specifiers construction order, so i fix it. Now the base specifier list is
being used for figuring out the correct subobject field. Also this diff
kromanenkov added inline comments.
Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:899
+case UO_AddrOf: {
+ // Process pointer-to-member address operation
+ const Expr *Ex = U->getSubExpr()->IgnoreParens();
kromanenkov wrote:
> dcoughlin wrote:
kromanenkov added inline comments.
Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:899
+case UO_AddrOf: {
+ // Process pointer-to-member address operation
+ const Expr *Ex = U->getSubExpr()->IgnoreParens();
dcoughlin wrote:
> Just sticking this
dcoughlin added a comment.
PointerToMemberData looks like it is on the right track! One thing that is
still missing is using the base specifier list to figure out the correct
subobject field to read and write from. This is important when there is
non-virtual multiple inheritance, as there will
kromanenkov marked an inline comment as done.
kromanenkov added inline comments.
Comment at:
include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h:217
+
+ llvm::ImmutableList consCXXBase(
+ const CXXBaseSpecifier *CBS,
NoQ wrote:
> Hmm, is it
kromanenkov updated this revision to Diff 79560.
kromanenkov added a comment.
Thanks for your comments, Artem! Make function name less ambiguous. Also I take
liberty to update analogical function name.
https://reviews.llvm.org/D25475
Files:
include/clang/StaticAnalyzer/Core/PathSensitive/Bas
NoQ added a comment.
This looks good to me (bikeshedded a bit), but i think Devin should have
another look, because his comments were way deeper than mine.
Comment at:
include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h:217
+
+ llvm::ImmutableList consCXXBase
kromanenkov added a comment.
ping
https://reviews.llvm.org/D25475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kromanenkov added a comment.
ping
https://reviews.llvm.org/D25475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kromanenkov updated this revision to Diff 77041.
kromanenkov added a comment.
According to dcoughlin suggestion PointerToMember SVal is now modeled as a
PointerUnion of DeclaratorDecl and bump pointer-allocated object stored
DeclaratorDecl and immutable linked list of CXXBaseSpecifiers.
https:
dcoughlin added inline comments.
Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462
+ case CK_ReinterpretMemberPointer: {
+const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts();
+assert(isa(UOExpr) &&
kromanenkov wrote:
> dcoughli
kromanenkov added inline comments.
Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462
+ case CK_ReinterpretMemberPointer: {
+const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts();
+assert(isa(UOExpr) &&
dcoughlin wrote:
> dcoughli
dcoughlin added inline comments.
Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462
+ case CK_ReinterpretMemberPointer: {
+const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts();
+assert(isa(UOExpr) &&
dcoughlin wrote:
> dcoughlin
dcoughlin added inline comments.
Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462
+ case CK_ReinterpretMemberPointer: {
+const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts();
+assert(isa(UOExpr) &&
dcoughlin wrote:
> I don't th
dcoughlin added inline comments.
Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462
+ case CK_ReinterpretMemberPointer: {
+const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts();
+assert(isa(UOExpr) &&
I don't think pattern matchin
kromanenkov updated this revision to Diff 75020.
kromanenkov added a comment.
Null pointer-to-member dereference is now modeled as UndefinedVal. Fixing this
also releases us from loading from nonloc SVal.
I delete an assertion suppression in ExprEngine::performTrivialCopy because I
can't reprodu
NoQ added inline comments.
Comment at: test/Analysis/pointer-to-member.cpp:79
// FIXME: Should emit a null dereference.
return obj.*member; // no-warning
}
kromanenkov wrote:
> NoQ wrote:
> > In fact, maybe dereferencing a null pointer-to-member should pro
kromanenkov added inline comments.
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:2314
{
+ // Return to fulfil assert condition
+ if (location.getAs())
NoQ wrote:
> Hmm. Why would anybody try to load anything from a plain pointer-to-member,
> rather than
NoQ added a comment.
Yay, thanks for posting this! :)
I've got a bit of concern for some assert-suppressions.
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:2314
{
+ // Return to fulfil assert condition
+ if (location.getAs())
Hmm. Why would anybody try
kromanenkov created this revision.
kromanenkov added reviewers: zaks.anna, NoQ, dcoughlin.
kromanenkov added subscribers: a.sidorin, cfe-commits.
Add a new type of NonLoc SVal for pointer-to-member operations. This SVal
supports both pointers to member functions and pointers to member data.
htt
23 matches
Mail list logo