diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-31 20:20:33 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-31 20:20:33 +0000 |
commit | aa97b53175ef138144f69dbc7fda6870c5740226 (patch) | |
tree | 21ca0e9abfa9f53fa3ebbef4665e251abf0b26d5 /lib/AST/ExprConstant.cpp | |
parent | 56892c1c293d43b99fd84d27c831b1ce30541b0f (diff) |
Temporary fix for assert while evaluating array-to-pointer decay on array
rvalue. Test and better fix to follow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 9e1e75d702..a12beb5179 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -1223,7 +1223,9 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExpr* E) { } case CK_ArrayToPointerDecay: case CK_FunctionToPointerDecay: - return EvaluateLValue(SubExpr, Result, Info); + if (SubExpr->isGLValue() || SubExpr->getType()->isFunctionType()) + return EvaluateLValue(SubExpr, Result, Info); + return Error(E); } return ExprEvaluatorBaseTy::VisitCastExpr(E); |