[cfe-dev] [analyzer] Should we invalidate the `this` pointer?

Henry Wong via cfe-dev cfe-dev at lists.llvm.org
Sat Mar 31 02:02:36 PDT 2018


Hi all,

I recently encountered a assertion failure as shown below.

`Assertion `!InitValWithAdjustments.getAs<Loc>() || Loc::isLocType(Result->getType()) || Result->getType()->isMemberPointerType()' failed`

The code that will trigger this assertion failed.
----------------------------------------------------------------------------------------------------
struct BlockId {
BlockId();
};

void goo(BlockId id);

BlockId::BlockId() {
int count = 10;
do {

} while (count--);
}

int main() {
goo(BlockId());
}
----------------------------------------------------------------------------------------------------

The reason is that the analyzer invalidate the `this` pointer at loop-widen. The more essential question is "Should we invalidate the `this` pointer?"

Thanks in advance!

Henry Wong
Qihoo 360 Codesafe Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180331/fb181858/attachment.html>


More information about the cfe-dev mailing list