This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Fix incorrect CXXThisExpr pointee for lambdas
ClosedPublic

Authored by li.zhe.hua on May 25 2022, 1:17 PM.

Details

Summary

When constructing the Environment, the this pointee is established
for a CXXMethodDecl by looking at its parent. However, inside of
lambdas, a CXXThisExpr refers to the captured this coming from the
enclosing member function.

When establishing the this pointee for a function, we check whether
the function is a lambda, and check for an enclosing member function
to establish the this pointee storage location.

Diff Detail

Event Timeline

li.zhe.hua created this revision.May 25 2022, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 1:17 PM
li.zhe.hua requested review of this revision.May 25 2022, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 1:17 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ymandel accepted this revision.May 25 2022, 1:33 PM
ymandel added inline comments.
clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
1526

please use different name for the assertion (e.g. p2) when bundling two or more code snippets in a single test.

This revision is now accepted and ready to land.May 25 2022, 1:33 PM
sgatev accepted this revision.May 25 2022, 1:39 PM

Address reviewer comment.

This revision was landed with ongoing or failed builds.May 25 2022, 1:58 PM
This revision was automatically updated to reflect the committed changes.