]> granicus.if.org Git - clang/commit
[analyzer] Don't look through casts when creating pointer temporaries.
authorJordan Rose <jordan_rose@apple.com>
Tue, 26 Feb 2013 01:21:27 +0000 (01:21 +0000)
committerJordan Rose <jordan_rose@apple.com>
Tue, 26 Feb 2013 01:21:27 +0000 (01:21 +0000)
commiteafb5c694cc5d165149fcb9453bc9355fb0d44a5
treed0ceda24813738b32f9757875fdabd88e8bbd626
parenta0e6e6dd37f4acee8477c106d5e5679de015d120
[analyzer] Don't look through casts when creating pointer temporaries.

Normally, we need to look through derived-to-base casts when creating
temporary object regions (added in r175854). However, if the temporary
is a pointer (rather than a struct/class instance), we need to /preserve/
the base casts that have been applied.

This also ensures that we really do create a new temporary region when
we need to: MaterializeTemporaryExpr and lvalue CXXDefaultArgExprs.

Fixes PR15342, although the test case doesn't include the crash because
I couldn't isolate it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176069 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
test/Analysis/temporaries.cpp