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 {
1025
1025
SourceLoc loc = S->getThrowLoc ();
1026
1026
if (loc.isValid ()) {
1027
1027
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
+ }
1036
1034
} else {
1037
- thrownError = Ctx. getNeverType ( );
1035
+ thrownError = checkExceptionTypeExists ( " throw expression " );
1038
1036
}
1039
1037
} else {
1040
1038
return ;
You can’t perform that action at this time.
0 commit comments