Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 436c0deab931c3644feb0da7d5a23034b5e7cfd3)
+++ src/SymTab/Validate.cc	(revision 4551a6eded512f58326babd0f290704150f1f8e8)
@@ -160,5 +160,5 @@
 	};
 
-	class ReturnChecker {
+	class ReturnChecker : public WithScopes {
 	  public:
 		/// Checks that return statements return nothing if their return type is void
@@ -167,10 +167,8 @@
 	  private:
 		void previsit( FunctionDecl * functionDecl );
-		void postvisit( FunctionDecl * functionDecl );
 		void previsit( ReturnStmt * returnStmt );
 
 		typedef std::list< DeclarationWithType * > ReturnVals;
 		ReturnVals returnVals;
-		std::stack< ReturnVals > returnValsStack;
 	};
 
@@ -608,10 +606,6 @@
 
 	void ReturnChecker::previsit( FunctionDecl * functionDecl ) {
-		returnValsStack.push( returnVals );
+		GuardValue( returnVals );
 		returnVals = functionDecl->get_functionType()->get_returnVals();
-	}
-	void ReturnChecker::postvisit( __attribute__((unused)) FunctionDecl * functionDecl ) {
-		returnVals = returnValsStack.top();
-		returnValsStack.pop();
 	}
 
