diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-03-20 20:35:53 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-03-20 20:35:53 +0000 |
commit | f8ddc098981d4d85cad4e72fc6dfcfe83b842b66 (patch) | |
tree | f03f97abd1fd285147db499e1c4379d961cdc49a /include/clang/Basic/Module.h | |
parent | e1a2e90876cbe2187250939374d26036ccba2ad6 (diff) |
[analyzer] Invalidate regions indirectly accessible through const pointers.
In this case, the value of 'x' may be changed after the call to indirectAccess:
struct Wrapper {
int *ptr;
};
void indirectAccess(const Wrapper &w);
void test() {
int x = 42;
Wrapper w = { x };
clang_analyzer_eval(x == 42); // TRUE
indirectAccess(w);
clang_analyzer_eval(x == 42); // UNKNOWN
}
This is important for modelling return-by-value objects in C++, to show
that the contents of the struct are escaping in the return copy-constructor.
<rdar://problem/13239826>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Module.h')
0 files changed, 0 insertions, 0 deletions