Index: src/ResolvExpr/CurrentObject.cc
===================================================================
--- src/ResolvExpr/CurrentObject.cc	(revision caab99784c5d15e1c514e88927c965eafc7af1d5)
+++ src/ResolvExpr/CurrentObject.cc	(revision f64d9bc3d1151a54563d4b33bc6697f5b126435a)
@@ -38,20 +38,4 @@
 
 namespace ResolvExpr {
-	long long int getConstValue( ConstantExpr * constExpr ) {
-		if ( BasicType * basicType = dynamic_cast< BasicType * >( constExpr->get_result() ) ) {
-			if ( basicType->isInteger() ) {
-				return constExpr->get_constant()->get_ival();
-			} else {
-				assertf( false, "Non-integer constant expression in getConstValue %s", toString( constExpr ).c_str() ); // xxx - might be semantic error
-			}
-		} else if ( dynamic_cast< OneType * >( constExpr->get_result() ) ) {
-			return 1;
-		} else if ( dynamic_cast< ZeroType * >( constExpr->get_result() ) ) {
-			return 0;
-		} else {
-			assertf( false, "unhandled type on getConstValue %s", toString( constExpr->get_result() ).c_str() ); // xxx - might be semantic error
-		}
-	}
-
 	template< typename AggrInst >
 	TypeSubstitution makeGenericSubstitution( AggrInst * inst ) {
@@ -151,8 +135,17 @@
 		void setSize( Expression * expr ) {
 			if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) {
-				size = getConstValue( constExpr );
+				size = constExpr->intValue();
+				isVLA = false;
 				PRINT( std::cerr << "array type with size: " << size << std::endl; )
 			}	else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
 				setSize( castExpr->get_arg() ); // xxx - need to perform the conversion specified by the cast
+			} else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) {
+				if ( EnumInstType * inst = dynamic_cast< EnumInstType * > ( varExpr->result ) ) {
+					long long int value;
+					if ( inst->baseEnum->valueOf( varExpr->var, value ) ) {
+						size = value;
+						isVLA = false;
+					}
+				}
 			} else {
 				assertf( false, "unhandled expression in setSize: %s", toString( expr ).c_str() ); // xxx - if not a constant expression, it's not simple to determine how long the array actually is, which is necessary for initialization to be done correctly -- fix this
@@ -164,10 +157,14 @@
 			// need to permit integer-constant-expressions, including: integer constants, enumeration constants, character constants, sizeof expressions, _Alignof expressions, cast expressions
 			if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) {
-				index = getConstValue( constExpr );
+				index = constExpr->intValue();
 			} else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
 				setPosition( castExpr->get_arg() );
 			} else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) {
-				assertf( dynamic_cast<EnumInstType *> ( varExpr->get_result() ), "ArrayIterator given variable that isn't an enum constant : %s", toString( expr ).c_str() );
-				index = 0; // xxx - get actual value of enum constant
+				EnumInstType * inst = dynamic_cast<EnumInstType *>( varExpr->get_result() );
+				assertf( inst, "ArrayIterator given variable that isn't an enum constant : %s", toString( expr ).c_str() );
+				long long int value;
+				if ( inst->baseEnum->valueOf( varExpr->var, value ) ) {
+					index = value;
+				}
 			} else if ( dynamic_cast< SizeofExpr * >( expr ) || dynamic_cast< AlignofExpr * >( expr ) ) {
 				index = 0; // xxx - get actual sizeof/alignof value?
@@ -189,5 +186,5 @@
 		}
 
-		virtual operator bool() const { return index < size; }
+		virtual operator bool() const { return ! isVLA && index < size; }
 
 		virtual MemberIterator & bigStep() {
@@ -195,5 +192,5 @@
 			++index;
 			delete memberIter;
-			if ( index < size ) memberIter = createMemberIterator( base );
+			if ( ! isVLA && index < size ) memberIter = createMemberIterator( base );
 			else memberIter = nullptr;
 			return *this;
@@ -242,4 +239,5 @@
 		size_t index = 0;
 		size_t size = 0;
+		bool isVLA = true;
 		MemberIterator * memberIter = nullptr;
 	};
