Changeset 8cbf8cd for src/GenPoly
- Timestamp:
- Sep 22, 2015, 2:05:29 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- d0d9610
- Parents:
- 2f9956b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Specialize.cc
r2f9956b r8cbf8cd 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jun 13 15:54:07201513 // Update Count : 611 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Sep 22 14:04:13 2015 13 // Update Count : 15 14 14 // 15 15 … … 86 86 87 87 Expression * Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ) { 88 assert( ! actual->get_results().empty() ); 88 89 if ( needsSpecialization( formalType, actual->get_results().front(), env ) ) { 89 90 PointerType *ptrType; … … 167 168 Expression * Specialize::mutate( AddressExpr *addrExpr ) { 168 169 addrExpr->get_arg()->acceptMutator( *this ); 170 assert( ! addrExpr->get_results().empty() ); 169 171 addrExpr->set_arg( doSpecialization( addrExpr->get_results().front(), addrExpr->get_arg() ) ); 170 172 return addrExpr; … … 173 175 Expression * Specialize::mutate( CastExpr *castExpr ) { 174 176 castExpr->get_arg()->acceptMutator( *this ); 175 castExpr->set_arg( doSpecialization( castExpr->get_results().front(), castExpr->get_arg() ) ); 177 if ( ! castExpr->get_results().empty() ) { 178 // this may not be the correct condition, but previously the next statement 179 // was happening unchecked, causing a crash on a cast to void 180 castExpr->set_arg( doSpecialization( castExpr->get_results().front(), castExpr->get_arg() ) ); 181 } 176 182 return castExpr; 177 183 }
Note: See TracChangeset
for help on using the changeset viewer.