[clang][dataflow] Fix bug in handling of reference-typed fields.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Tue, 24 Jan 2023 14:51:32 +0000 (14:51 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Tue, 24 Jan 2023 16:10:50 +0000 (16:10 +0000)
commitb84ac96a35c72420b45db6385f83a5e0c516349f
tree65133deecc6dc4d720d7a2653f2321e8d820ece9
parentc84d74f5bfe810744de1268eb0516a6622e4aa73
[clang][dataflow] Fix bug in handling of reference-typed fields.

This patch fixes a subtle bug in how we create lvalues to reference-typed
fields. In the rare case that the field is umodeled because of the depth limit
on field modeling, the lvalue created can be malformed. This patch prevents that
and adds some related assertions to other code dealing with lvalues for
references.

Differential Revision: https://reviews.llvm.org/D142468
clang/lib/Analysis/FlowSensitive/Transfer.cpp
clang/unittests/Analysis/FlowSensitive/TransferTest.cpp