- File:
-
- 1 edited
-
src/ControlStruct/ExceptTranslate.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptTranslate.cc
rb2de2e0 r66ba544 10 10 // Created On : Wed Jun 14 16:49:00 2017 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : T ue May 26 10:56:00 202013 // Update Count : 1 612 // Last Modified On : Thr May 21 13:18:00 2020 13 // Update Count : 15 14 14 // 15 15 … … 107 107 nameOf( terminate_handler_except ), 108 108 new ConstantExpr( Constant::null( 109 terminate_handler_except->get_type()->clone() 109 //new PointerType( 110 // noQualifiers, 111 terminate_handler_except->get_type()->clone() 112 // ) 110 113 ) ) 111 114 ) ) ); … … 134 137 ObjectDecl * decl = dynamic_cast<ObjectDecl *>( catchStmt->get_decl() ); 135 138 // Also checking the type would be nice. 136 if ( !decl || !dynamic_cast<PointerType *>( decl->type ) ) { 137 std::string kind = (CatchStmt::Terminate == catchStmt->kind) ? "catch" : "catchResume"; 138 SemanticError( catchStmt->location, kind + " must have pointer to an exception type" ); 139 if ( decl ) { 140 // Pass. 141 } else if ( CatchStmt::Terminate == catchStmt->get_kind() ) { 142 SemanticError(catchStmt->location, "catch must have exception type"); 143 } else { 144 SemanticError(catchStmt->location, "catchResume must have exception type"); 139 145 } 140 146 … … 226 232 227 233 void premutate( StructDecl *structDecl ); 234 Statement * postmutate( ThrowStmt *throwStmt ); 228 235 Statement * postmutate( TryStmt *tryStmt ); 229 236 }; … … 614 621 } 615 622 623 Statement * TryMutatorCore::postmutate( ThrowStmt * ) { 624 // All throws should be removed by this point. 625 assert( false ); 626 } 627 616 628 Statement * TryMutatorCore::postmutate( TryStmt *tryStmt ) { 617 629 assert( except_decl );
Note:
See TracChangeset
for help on using the changeset viewer.