summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCoroutine.cpp
diff options
context:
space:
mode:
authorGor Nishanov <GorNishanov@gmail.com>2017-03-28 02:51:45 +0000
committerGor Nishanov <GorNishanov@gmail.com>2017-03-28 02:51:45 +0000
commitc4a1908681dfbac19239b956f811b0f666de0ecc (patch)
tree52508ad26700dd87bded781044fbae6276c1b944 /clang/lib/Sema/SemaCoroutine.cpp
parent3a6951250c642af1e2fe5cd72fe1deb740552451 (diff)
downloadbcm5719-llvm-c4a1908681dfbac19239b956f811b0f666de0ecc.tar.gz
bcm5719-llvm-c4a1908681dfbac19239b956f811b0f666de0ecc.zip
Use BuildReturnStmt in SemaCoroutine to unbreak sanitizer tests.
FIXME: ActOnReturnStmt expects a scope that is inside of the function, due to CheckJumpOutOfSEHFinally(*this, ReturnLoc, *CurScope->getFnParent()); S.getCurScope()->getFnParent() == nullptr at ActOnFinishFunctionBody when CoroutineBodyStmt is built. Figure it out and fix it. llvm-svn: 298893
Diffstat (limited to 'clang/lib/Sema/SemaCoroutine.cpp')
-rw-r--r--clang/lib/Sema/SemaCoroutine.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp
index d8e7b9bb186..14dd7cb7118 100644
--- a/clang/lib/Sema/SemaCoroutine.cpp
+++ b/clang/lib/Sema/SemaCoroutine.cpp
@@ -830,8 +830,13 @@ bool SubStmtBuilder::makeReturnOnAllocFailure() {
S.ActOnCallExpr(nullptr, DeclNameExpr.get(), Loc, {}, Loc);
if (ReturnObjectOnAllocationFailure.isInvalid()) return false;
- StmtResult ReturnStmt = S.ActOnReturnStmt(
- Loc, ReturnObjectOnAllocationFailure.get(), S.getCurScope());
+ // FIXME: ActOnReturnStmt expects a scope that is inside of the function, due
+ // to CheckJumpOutOfSEHFinally(*this, ReturnLoc, *CurScope->getFnParent());
+ // S.getCurScope()->getFnParent() == nullptr at ActOnFinishFunctionBody when
+ // CoroutineBodyStmt is built. Figure it out and fix it.
+ // Use BuildReturnStmt here to unbreak sanitized tests. (Gor:3/27/2017)
+ StmtResult ReturnStmt =
+ S.BuildReturnStmt(Loc, ReturnObjectOnAllocationFailure.get());
if (ReturnStmt.isInvalid()) return false;
this->ReturnStmtOnAllocFailure = ReturnStmt.get();
OpenPOWER on IntegriCloud