summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-08 00:36:37 +0000
committerChris Lattner <sabre@nondot.org>2009-09-08 00:36:37 +0000
commit870158eebf1937c20cc3b311b830566201377f1e (patch)
treeff02a9fb0156ed800d551ad65b13d5bc5cd1d334 /clang/lib
parentf2ab40a46f924b6bd178c3bc658c44a2f8ed209d (diff)
downloadbcm5719-llvm-870158eebf1937c20cc3b311b830566201377f1e.tar.gz
bcm5719-llvm-870158eebf1937c20cc3b311b830566201377f1e.zip
reject returning a block expr even when it has parens and casts in the way.
llvm-svn: 81176
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 24eb8b1d5e0..a63e044272e 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -1254,9 +1254,7 @@ Sema::CheckReturnStackAddr(Expr *RetValExp, QualType lhsType,
<< DR->getDecl()->getDeclName() << RetValExp->getSourceRange();
// Skip over implicit cast expressions when checking for block expressions.
- if (ImplicitCastExpr *IcExpr =
- dyn_cast_or_null<ImplicitCastExpr>(RetValExp))
- RetValExp = IcExpr->getSubExpr();
+ RetValExp = RetValExp->IgnoreParenCasts();
if (BlockExpr *C = dyn_cast_or_null<BlockExpr>(RetValExp))
if (C->hasBlockDeclRefExprs())
OpenPOWER on IntegriCloud