Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 23b6643f5ea88fa1b0e11583e2f0ed9315a515de)
+++ src/CodeGen/CodeGenerator.cc	(revision c5cb613099f2fdd80518c1423be411f72bd629c4)
@@ -307,8 +307,11 @@
 						} else {
 							// no address-of operator, so must be a pointer - add dereference
+							// NOTE: if the assertion starts to trigger, check that the application expr isn't being shared.
+							// Since its arguments are modified here, this assertion most commonly triggers when the application
+							// is visited multiple times.
 							UntypedExpr * newExpr = new UntypedExpr( new NameExpr( "*?" ) );
 							newExpr->get_args().push_back( *arg );
 							Type * type = InitTweak::getPointerBase( (*arg)->get_result() );
-							assert( type );
+							assertf( type, "First argument to a derefence must be a pointer. Ensure that expressions are not being shared." );
 							newExpr->set_result( type->clone() );
 							*arg = newExpr;
