diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-01-09 09:16:47 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-01-09 09:16:47 +0000 |
commit | bc37b8dd9914e02580f531fa6e5e72be34d9675e (patch) | |
tree | e1dfe8fab77de3a9ff2679dbb4ea65749aeb6007 /lib/Analysis/Environment.cpp | |
parent | 7a7ca281bcf50b34de1ce067d3c55879b81722ae (diff) |
When binding an rvalue to a reference, create a temporary object. Use
CXXObjectRegion to represent it.
In Environment, lookup a literal expression before make up a value for it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/Environment.cpp')
-rw-r--r-- | lib/Analysis/Environment.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Analysis/Environment.cpp b/lib/Analysis/Environment.cpp index dd2f08b48f..f04cf7b05f 100644 --- a/lib/Analysis/Environment.cpp +++ b/lib/Analysis/Environment.cpp @@ -37,7 +37,12 @@ SVal Environment::GetSVal(const Stmt *E, ValueManager& ValMgr) const { } case Stmt::IntegerLiteralClass: { - return ValMgr.makeIntVal(cast<IntegerLiteral>(E)); + // In C++, this expression may have been bound to a temporary object. + SVal const *X = ExprBindings.lookup(E); + if (X) + return *X; + else + return ValMgr.makeIntVal(cast<IntegerLiteral>(E)); } // Casts where the source and target type are the same |