File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -1025,16 +1025,14 @@ class Verifier : public ASTWalker {
10251025 SourceLoc loc = S->getThrowLoc ();
10261026 if (loc.isValid ()) {
10271027 auto catchNode = ASTScope::lookupCatchNode (getModuleContext (), loc);
1028-
1029- if (!catchNode) {
1030- Out << " No catch context for throw statement\n " ;
1031- abort ();
1032- }
1033-
1034- if (auto thrown = catchNode.getThrownErrorTypeInContext (Ctx)) {
1035- thrownError = *thrown;
1028+ if (catchNode) {
1029+ if (auto thrown = catchNode.getThrownErrorTypeInContext (Ctx)) {
1030+ thrownError = *thrown;
1031+ } else {
1032+ thrownError = Ctx.getNeverType ();
1033+ }
10361034 } else {
1037- thrownError = Ctx. getNeverType ( );
1035+ thrownError = checkExceptionTypeExists ( " throw expression " );
10381036 }
10391037 } else {
10401038 return ;
You can’t perform that action at this time.
0 commit comments