This revision was automatically updated to reflect the committed changes.
Closed by commit rC330095: [analyzer] Do not invalidate the `this` pointer.
(authored by henrywong, committed by ).
Repository:
rC Clang
https://reviews.llvm.org/D45491
Files:
lib/StaticAnalyzer/Core/LoopWidening.cpp
MTC added a comment.
In https://reviews.llvm.org/D45491#1067852, @NoQ wrote:
> Yeah, i think this makes sense, thanks! It feels a bit weird that we have to
> add it as an exception - i wonder if there are other exceptions that we need
> to make. Widening over the stack memory space should be a
NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.
Yeah, i think this makes sense, thanks! It feels a bit weird that we have to
add it as an exception - i wonder if there are other exceptions that we need to
make. Widening over the stack memory spac
MTC updated this revision to Diff 142026.
MTC marked 2 inline comments as done.
MTC added a comment.
- Move the `CXXThisRegion`'s check to `LoopWidening.cpp`
- Use `isa(R)` instead of `CXXThisRegion::classof(R)`.
Repository:
rC Clang
https://reviews.llvm.org/D45491
Files:
lib/StaticAnalyze
MTC marked 2 inline comments as done.
MTC added inline comments.
Comment at: lib/StaticAnalyzer/Core/RegionStore.cpp:1024-1027
+ // 'this' pointer is not an lvalue, we should not invalidate it.
+ if (CXXThisRegion::classof(baseR))
+return;
+
NoQ wrote:
> I
MTC added a comment.
In https://reviews.llvm.org/D45491#1063364, @george.karpenkov wrote:
> @MTC what happens for
>
> this.j = 0;
> for (int i=0; i<100; i++)
> this.j++;
>
>
> ?
@george.karpenkov `this`'s value will remain unchanged, `j` will be
invalidated.
1 void clang_analyz
NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Core/RegionStore.cpp:1024-1027
+ // 'this' pointer is not an lvalue, we should not invalidate it.
+ if (CXXThisRegion::classof(baseR))
+return;
+
I don't think this run-time check belongs here. The f
george.karpenkov added a comment.
@MTC what happens for
this.j = 0;
for (int i=0; i<100; i++)
this.j++;
?
Repository:
rC Clang
https://reviews.llvm.org/D45491
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.or
MTC created this revision.
MTC added reviewers: NoQ, george.karpenkov, a.sidorin, seaneveson, szepet.
Herald added subscribers: cfe-commits, rnkovacs, xazax.hun.
MTC edited the summary of this revision.
`this` pointer is not an l-value, although we have modeled `CXXThisRegion` for
`this` pointer,