Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 407177825659d62a6de84dc273a284baeece4688)
+++ src/SymTab/Validate.cc	(revision 0f19f5e5507e9dee674ac823dabb5c0e9702f2c5)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 21:50:04 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Aug 28 13:47:23 2017
-// Update Count     : 359
+// Last Modified By : Andrew Beach
+// Last Modified On : Wed Aug  7 6:42:00 2019
+// Update Count     : 360
 //
 
@@ -81,4 +81,5 @@
 #include "SynTree/Label.h"             // for operator==, Label
 #include "SynTree/Mutator.h"           // for Mutator
+#include "SynTree/TopLvalue.h"         // for assertTopLvalue, clearInnerLvalue
 #include "SynTree/Type.h"              // for Type, TypeInstType, EnumInstType
 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
@@ -308,4 +309,5 @@
 		PassVisitor<FixQualifiedTypes> fixQual;
 
+		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-A");
@@ -316,20 +318,27 @@
 			acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes_old because it is an indexer and needs correct types for mangling
 		}
+		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-B");
 			Stats::Time::BlockGuard guard("validate-B");
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Link Reference To Types", [&]() {
 				acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
 			});
+			clearInnerLvalue( translationUnit );
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Fix Qualified Types", [&]() {
 				mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed
 			});
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Hoist Structs", [&]() {
 				HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order
 			});
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Eliminate Typedefs", [&]() {
 				EliminateTypedef::eliminateTypedef( translationUnit ); //
 			});
 		}
+		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-C");
@@ -340,55 +349,77 @@
 			InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen
 		}
+		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-D");
 			Stats::Time::BlockGuard guard("validate-D");
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() {
 				Concurrency::applyKeywords( translationUnit );
 			});
+			clearInnerLvalue( translationUnit );
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Forall Pointer Decay", [&]() {
 				acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
 			});
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Hoist Control Declarations", [&]() {
 				ControlStruct::hoistControlDecls( translationUnit );  // hoist initialization out of for statements; must happen before autogenerateRoutines
 			});
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Generate Autogen routines", [&]() {
 				autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay_old
 			});
-		}
+			clearInnerLvalue( translationUnit );
+		}
+		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-E");
 			Stats::Time::BlockGuard guard("validate-E");
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Implement Mutex Func", [&]() {
 				Concurrency::implementMutexFuncs( translationUnit );
 			});
+			clearInnerLvalue( translationUnit );
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Implement Thread Start", [&]() {
 				Concurrency::implementThreadStarter( translationUnit );
 			});
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Compound Literal", [&]() {
 				mutateAll( translationUnit, compoundliteral );
 			});
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Resolve With Expressions", [&]() {
 				ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables
 			});
-		}
+			clearInnerLvalue( translationUnit );
+		}
+		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-F");
 			Stats::Time::BlockGuard guard("validate-F");
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Fix Object Type", [&]() {
 				FixObjectType::fix( translationUnit );
 			});
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Array Length", [&]() {
 				ArrayLength::computeLength( translationUnit );
 			});
+			clearInnerLvalue( translationUnit );
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Find Special Declarations", [&]() {
 				Validate::findSpecialDecls( translationUnit );
 			});
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Fix Label Address", [&]() {
 				mutateAll( translationUnit, labelAddrFixer );
 			});
+			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Handle Attributes", [&]() {
 				Validate::handleAttributes( translationUnit );
 			});
 		}
+		assertTopLvalue( translationUnit );
 	}
 
