Added extra semantic checking to do basic detection of
"return of stack addresses."  ParseReturnStmt now calls CheckReturnStackAddr
to determine if the expression in the return statement evaluates to an
address of a stack variable.  If so, we issue a warning. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41141 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaStmt.cpp b/Sema/SemaStmt.cpp
index b3a1f1c..8932f98 100644
--- a/Sema/SemaStmt.cpp
+++ b/Sema/SemaStmt.cpp
@@ -358,6 +358,9 @@
          RetValExp->getSourceRange());
     break;
   }
+  
+  if (RetValExp) CheckReturnStackAddr(RetValExp, lhsType, ReturnLoc);
+  
   return new ReturnStmt((Expr*)RetValExp);
 }