Changes in / [926341c:79dbb79]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptTranslate.cc
r926341c r79dbb79 10 10 // Created On : Wed Jun 14 16:49:00 2017 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 28 1 5:34:00 201713 // Update Count : 612 // Last Modified On : Fri Jul 28 14:03:00 2017 13 // Update Count : 5 14 14 // 15 15 … … 224 224 CompoundStmt * block = new CompoundStmt( noLabels ); 225 225 226 // Just copy the exception value. (Post Validation) 226 // Just copy the exception value. 227 // TODO: Or just store an ObjectDecl? 227 228 ObjectDecl * handler_decl = 228 static_cast<ObjectDecl *>( handler->get_decl() ); 229 dynamic_cast<ObjectDecl*>( handler->get_decl() ); 230 assert( handler_decl ); 229 231 ObjectDecl * local_except = handler_decl->clone(); 230 232 local_except->set_init( … … 240 242 241 243 // Save a cast copy of the exception (should always succeed). 242 local_except->set_init( 244 ObjectDecl * local_except = handler->get_decl()->clone(); 245 local_except.set_init( 243 246 new ListInit({ new SingleInit( 244 247 new VirtualCastExpr( nameOf( except_obj ), 245 248 local_except->get_type() 246 249 ) 247 ) }) 248 ); 250 ) }) ); 249 251 #endif 250 252 block->push_back( new DeclStmt( noLabels, local_except ) ); … … 586 588 catchStmt->set_decl( tmp ); 587 589 588 // Validate the Statement's form.589 ObjectDecl * decl =590 dynamic_cast<ObjectDecl *>( catchStmt->get_decl() );591 if ( decl && true /* check decl->get_type() */ ) {592 // Pass.593 } else if ( CatchStmt::Terminate == catchStmt->get_kind() ) {594 throw SemanticError("catch must have exception type");595 } else {596 throw SemanticError("catchResume must have exception type");597 }598 599 // Track the handler context.600 590 GuardValue( cur_context ); 601 591 if ( CatchStmt::Terminate == catchStmt->get_kind() ) { … … 603 593 604 594 GuardValue( handler_except_decl ); 605 handler_except_decl = decl; 595 handler_except_decl = tmp; 596 //handler_except_decl = catchStmt->get_decl(); 606 597 } else { 607 598 cur_context = ResHandler;
Note: See TracChangeset
for help on using the changeset viewer.