diff options
author | Vince Bridgers <vince.a.bridgers@gmail.com> | 2021-09-28 08:42:31 -0500 |
---|---|---|
committer | einvbri <vince.a.bridgers@ericsson.com> | 2021-10-06 05:18:27 -0500 |
commit | b29186c08ae230d0decbca67565be68919c6b24d (patch) | |
tree | 25ee1f76f835553acf1ee2cfc31e8b36e76cfe42 /clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | |
parent | c11e7b59d2e9a221b2a956dcc0e0711eec12118e (diff) | |
download | llvm-b29186c08ae230d0decbca67565be68919c6b24d.zip llvm-b29186c08ae230d0decbca67565be68919c6b24d.tar.gz llvm-b29186c08ae230d0decbca67565be68919c6b24d.tar.bz2 |
[analyzer] canonicalize special case of structure/pointer deref
This simple change addresses a special case of structure/pointer
aliasing that produced different symbolvals, leading to false positives
during analysis.
The reproducer is as simple as this.
```lang=C++
struct s {
int v;
};
void foo(struct s *ps) {
struct s ss = *ps;
clang_analyzer_dump(ss.v); // reg_$1<int Element{SymRegion{reg_$0<struct s *ps>},0 S64b,struct s}.v>
clang_analyzer_dump(ps->v); //reg_$3<int SymRegion{reg_$0<struct s *ps>}.v>
clang_analyzer_eval(ss.v == ps->v); // UNKNOWN
}
```
Acks: Many thanks to @steakhal and @martong for the group debug session.
Reviewed By: steakhal, martong
Differential Revision: https://reviews.llvm.org/D110625
Diffstat (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
0 files changed, 0 insertions, 0 deletions