Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 1b31345292deaf79f2d56840d77c38c98d8d206c)
+++ src/InitTweak/FixInit.cc	(revision 4ffdd638467baad09e66da0dfc9fb3e7dd4f9f5a)
@@ -10,5 +10,5 @@
 // Created On       : Wed Jan 13 16:29:30 2016
 // Last Modified By : Rob Schluntz
-// Last Modified On : Tue Apr 26 14:57:13 2016
+// Last Modified On : Wed Apr 27 17:08:44 2016
 // Update Count     : 30
 //
@@ -216,7 +216,6 @@
 			if ( function->get_var()->get_linkage() != LinkageSpec::Intrinsic ) {
 				// replace argument to function call with temporary
-				arg = new VariableExpr( tmp );
+				arg = new CommaExpr( cpCtor, new VariableExpr( tmp ) );
 				impCpCtorExpr->get_tempDecls().push_back( tmp );
-				impCpCtorExpr->get_copyCtors().push_back( cpCtor );
 				impCpCtorExpr->get_dtors().push_front( makeCtorDtor( "^?{}", tmp ) );
 			}
@@ -232,5 +231,5 @@
 		callExpr->set_env( impCpCtorExpr->get_env()->clone() );
 		for ( Type * result : appExpr->get_results() ) {
-			ObjectDecl * ret = new ObjectDecl( retNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, result->clone(), new SingleInit( callExpr ) );
+			ObjectDecl * ret = new ObjectDecl( retNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, result->clone(), 0 );
 			ret->get_type()->set_isConst( false );
 			impCpCtorExpr->get_returnDecls().push_back( ret );
@@ -249,5 +248,4 @@
 		assert( impCpCtorExpr );
 
-		std::list< Expression * > & copyCtors = impCpCtorExpr->get_copyCtors();
 		std::list< ObjectDecl * > & tempDecls = impCpCtorExpr->get_tempDecls();
 		std::list< ObjectDecl * > & returnDecls = impCpCtorExpr->get_returnDecls();
@@ -256,8 +254,8 @@
 		// add all temporary declarations and their constructors
 		for ( ObjectDecl * obj : tempDecls ) {
-			assert( ! copyCtors.empty() );
 			stmtsToAdd.push_back( new DeclStmt( noLabels, obj ) );
-			stmtsToAdd.push_back( new ExprStmt( noLabels, copyCtors.front() ) );
-			copyCtors.pop_front();
+		}
+		for ( ObjectDecl * obj : returnDecls ) {
+			stmtsToAdd.push_back( new DeclStmt( noLabels, obj ) );
 		}
 
@@ -274,5 +272,4 @@
 
 		// xxx - some of these aren't necessary, and can be removed once this is stable
-		copyCtors.clear();
 		dtors.clear();
 		tempDecls.clear();
@@ -282,10 +279,13 @@
 
 		if ( returnDecl ) {
-			// call is currently attached to first returnDecl
-			stmtsToAdd.push_back( new DeclStmt( noLabels, returnDecl ) );
-			return new VariableExpr( returnDecl );
+			UntypedExpr * assign = new UntypedExpr( new NameExpr( "?=?" ) );
+			assign->get_args().push_back( new VariableExpr( returnDecl ) );
+			assign->get_args().push_back( callExpr );
+			// know the result type of the assignment is the type of the LHS (minus the pointer), so
+			// add that onto the assignment expression so that later steps have the necessary information
+			assign->add_result( returnDecl->get_type()->clone() );
+			// return new CommaExpr( assign, new VariableExpr( returnDecl ) );
+			return assign;
 		} else {
-			// add call expression - if no return values, can call directly
-			assert( callExpr );
 			return callExpr;
 		}
