Changes in / [52f3539:61e2761]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptTranslate.cc
r52f3539 r61e2761 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 4:03:00 201713 // Update Count : 512 // Last Modified On : Fri Jul 28 15:34:00 2017 13 // Update Count : 6 14 14 // 15 15 … … 224 224 CompoundStmt * block = new CompoundStmt( noLabels ); 225 225 226 // Just copy the exception value. 227 // TODO: Or just store an ObjectDecl? 226 // Just copy the exception value. (Post Validation) 228 227 ObjectDecl * handler_decl = 229 dynamic_cast<ObjectDecl*>( handler->get_decl() ); 230 assert( handler_decl ); 228 static_cast<ObjectDecl *>( handler->get_decl() ); 231 229 ObjectDecl * local_except = handler_decl->clone(); 232 230 local_except->set_init( … … 242 240 243 241 // Save a cast copy of the exception (should always succeed). 244 ObjectDecl * local_except = handler->get_decl()->clone(); 245 local_except.set_init( 242 local_except->set_init( 246 243 new ListInit({ new SingleInit( 247 244 new VirtualCastExpr( nameOf( except_obj ), 248 245 local_except->get_type() 249 246 ) 250 ) }) ); 247 ) }) 248 ); 251 249 #endif 252 250 block->push_back( new DeclStmt( noLabels, local_except ) ); … … 588 586 catchStmt->set_decl( tmp ); 589 587 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. 590 600 GuardValue( cur_context ); 591 601 if ( CatchStmt::Terminate == catchStmt->get_kind() ) { … … 593 603 594 604 GuardValue( handler_except_decl ); 595 handler_except_decl = tmp; 596 //handler_except_decl = catchStmt->get_decl(); 605 handler_except_decl = decl; 597 606 } else { 598 607 cur_context = ResHandler;
Note: See TracChangeset
for help on using the changeset viewer.