@@ -382,8 +382,6 @@ void linkingt::link_error(
382
382
error () << " new definition in module `" << new_symbol.module
383
383
<< " ' " << new_symbol.location << ' \n '
384
384
<< type_to_string_verbose (ns, new_symbol) << eom;
385
-
386
- throw 0 ;
387
385
}
388
386
389
387
void linkingt::link_warning (
@@ -573,6 +571,9 @@ void linkingt::duplicate_code_symbol(
573
571
old_symbol,
574
572
new_symbol,
575
573
" conflicting parameter counts of function declarations" );
574
+
575
+ // error logged, continue typechecking other symbols
576
+ return ;
576
577
}
577
578
else
578
579
{
@@ -602,19 +603,31 @@ void linkingt::duplicate_code_symbol(
602
603
if (o_it!=old_t .parameters ().end ())
603
604
{
604
605
if (!new_t .has_ellipsis () && old_symbol.value .is_not_nil ())
606
+ {
605
607
link_error (
606
608
old_symbol,
607
609
new_symbol,
608
610
" conflicting parameter counts of function declarations" );
611
+
612
+ // error logged, continue typechecking other symbols
613
+ return ;
614
+ }
615
+
609
616
replace=new_symbol.value .is_not_nil ();
610
617
}
611
618
else if (n_it!=new_t .parameters ().end ())
612
619
{
613
620
if (!old_t .has_ellipsis () && new_symbol.value .is_not_nil ())
621
+ {
614
622
link_error (
615
623
old_symbol,
616
624
new_symbol,
617
625
" conflicting parameter counts of function declarations" );
626
+
627
+ // error logged, continue typechecking other symbols
628
+ return ;
629
+ }
630
+
618
631
replace=new_symbol.value .is_not_nil ();
619
632
}
620
633
@@ -708,6 +721,9 @@ void linkingt::duplicate_code_symbol(
708
721
old_symbol,
709
722
new_symbol,
710
723
" conflicting function declarations" );
724
+
725
+ // error logged, continue typechecking other symbols
726
+ return ;
711
727
}
712
728
else
713
729
{
@@ -876,10 +892,15 @@ bool linkingt::adjust_object_type_rec(
876
892
equal_exprt eq (old_size, new_size);
877
893
878
894
if (!simplify_expr (eq, ns).is_true ())
895
+ {
879
896
link_error (
880
897
info.old_symbol ,
881
898
info.new_symbol ,
882
899
" conflicting array sizes for variable" );
900
+
901
+ // error logged, continue typechecking other symbols
902
+ return true ;
903
+ }
883
904
}
884
905
885
906
return false ;
@@ -958,6 +979,9 @@ void linkingt::duplicate_object_symbol(
958
979
old_symbol,
959
980
new_symbol,
960
981
" conflicting types for variable" );
982
+
983
+ // error logged, continue typechecking other symbols
984
+ return ;
961
985
}
962
986
else if (set_to_new)
963
987
old_symbol.type =new_symbol.type ;
@@ -1022,11 +1046,16 @@ void linkingt::duplicate_non_type_symbol(
1022
1046
bool is_code_new_symbol=new_symbol.type .id ()==ID_code;
1023
1047
1024
1048
if (is_code_old_symbol!=is_code_new_symbol)
1049
+ {
1025
1050
link_error (
1026
1051
old_symbol,
1027
1052
new_symbol,
1028
1053
" conflicting definition for symbol" );
1029
1054
1055
+ // error logged, continue typechecking other symbols
1056
+ return ;
1057
+ }
1058
+
1030
1059
if (is_code_old_symbol)
1031
1060
duplicate_code_symbol (old_symbol, new_symbol);
1032
1061
else
@@ -1048,11 +1077,16 @@ void linkingt::duplicate_type_symbol(
1048
1077
assert (new_symbol.is_type );
1049
1078
1050
1079
if (!old_symbol.is_type )
1080
+ {
1051
1081
link_error (
1052
1082
old_symbol,
1053
1083
new_symbol,
1054
1084
" conflicting definition for symbol" );
1055
1085
1086
+ // error logged, continue typechecking other symbols
1087
+ return ;
1088
+ }
1089
+
1056
1090
if (old_symbol.type ==new_symbol.type )
1057
1091
return ;
1058
1092
0 commit comments