Index: src/GenPoly/Specialize.cc
===================================================================
--- src/GenPoly/Specialize.cc	(revision 09f800bd7b91671fcde02aa251d4cb0eecc48ae1)
+++ src/GenPoly/Specialize.cc	(revision 84b08d4aa30bdb46d08bafb9f6f54341f4a873bb)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 13 15:54:07 2015
-// Update Count     : 6
+// Last Modified By : Rob Schluntz
+// Last Modified On : Tue Sep 22 14:04:13 2015
+// Update Count     : 15
 //
 
@@ -86,4 +86,5 @@
 
 	Expression * Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ) {
+		assert( ! actual->get_results().empty() );
 		if ( needsSpecialization( formalType, actual->get_results().front(), env ) ) {
 			PointerType *ptrType;
@@ -167,4 +168,5 @@
 	Expression * Specialize::mutate( AddressExpr *addrExpr ) {
 		addrExpr->get_arg()->acceptMutator( *this );
+		assert( ! addrExpr->get_results().empty() );
 		addrExpr->set_arg( doSpecialization( addrExpr->get_results().front(), addrExpr->get_arg() ) );
 		return addrExpr;
@@ -173,5 +175,9 @@
 	Expression * Specialize::mutate( CastExpr *castExpr ) {
 		castExpr->get_arg()->acceptMutator( *this );
-		castExpr->set_arg( doSpecialization( castExpr->get_results().front(), castExpr->get_arg() ) );
+		if ( ! castExpr->get_results().empty() ) {
+			// this may not be the correct condition, but previously the next statement 
+			// was happening unchecked, causing a crash on a cast to void
+			castExpr->set_arg( doSpecialization( castExpr->get_results().front(), castExpr->get_arg() ) );		
+		}
 		return castExpr;
 	}
