diff options
author | Mike Stump <mrs@apple.com> | 2009-02-19 22:01:56 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-02-19 22:01:56 +0000 |
commit | b83d287bc7f47d36fb0751a481e2ef9308b37252 (patch) | |
tree | ed7d31e8981c0c922eaf3eb653f0573182275658 /lib/AST/ExprConstant.cpp | |
parent | f084663ed01cbe382c700947908b4130fec0406a (diff) |
Add enough checking to ensure that non-constant block literals don't
appear to be constant. I'll probably redo this and throw it all away
later once we have codegen for BlockDeclRefExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 540a6377f2..51c581a708 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -260,7 +260,11 @@ public: APValue VisitAddrLabelExpr(AddrLabelExpr *E) { return APValue(E, 0); } APValue VisitCallExpr(CallExpr *E); - APValue VisitBlockExpr(BlockExpr *E) { return APValue(E, 0); } + APValue VisitBlockExpr(BlockExpr *E) { + if (!E->hasBlockDeclRefExprs()) + return APValue(E, 0); + return APValue(); + } APValue VisitConditionalOperator(ConditionalOperator *E); }; } // end anonymous namespace |