diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-12-17 02:24:21 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-12-17 02:24:21 +0000 |
commit | f59ff8c777379bd54137853a58c58b72fb869152 (patch) | |
tree | bf896606799583e62e6ad1847fbcf5ecd53b0410 /lib/AST/ExprConstant.cpp | |
parent | d7dd7755fc5092c69f492d6f32cb0e34e63c6a53 (diff) |
Add a missing check before trying to evaluate a temporary. PR11595.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146813 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 31b211eff6..0d32ebf1c6 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -2066,6 +2066,9 @@ public: return false; BaseTy = E->getBase()->getType()->getAs<PointerType>()->getPointeeType(); } else if (E->getBase()->isRValue()) { + if (!E->getBase()->getType()->isRecordType() || + !E->getBase()->getType()->isLiteralType()) + return false; if (!EvaluateTemporary(E->getBase(), Result, this->Info)) return false; BaseTy = E->getBase()->getType(); |