|
6 | 6 |
|
7 | 7 | Copyright (c) 2005-2020 Kestrel Technology LLC |
8 | 8 | Copyright (c) 2020 Henny Sipma |
9 | | - Copyright (c) 2021-2024 Aarno Labs LLC |
| 9 | + Copyright (c) 2021-2025 Aarno Labs LLC |
10 | 10 |
|
11 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy |
12 | 12 | of this software and associated documentation files (the "Software"), to deal |
@@ -184,7 +184,12 @@ let analyze starttime = |
184 | 184 | faddr#toPretty; |
185 | 185 | STR ": "; |
186 | 186 | p]); |
187 | | - failedfunctions := faddr :: !failedfunctions |
| 187 | + if system_settings#fail_on_function_failure then |
| 188 | + raise |
| 189 | + (BCH_failure |
| 190 | + (LBLOCK [STR "Function failure of "; faddr#toPretty; STR ": "; p])) |
| 191 | + else |
| 192 | + failedfunctions := faddr :: !failedfunctions |
188 | 193 | end in |
189 | 194 |
|
190 | 195 | begin |
@@ -414,7 +419,12 @@ let analyze_mips starttime = |
414 | 419 | faddr#toPretty; |
415 | 420 | STR ": "; |
416 | 421 | p]); |
417 | | - failedfunctions := faddr :: !failedfunctions |
| 422 | + if system_settings#fail_on_function_failure then |
| 423 | + raise |
| 424 | + (BCH_failure |
| 425 | + (LBLOCK [STR "Function failure of "; faddr#toPretty; STR "; "; p])) |
| 426 | + else |
| 427 | + failedfunctions := faddr :: !failedfunctions |
418 | 428 | end in |
419 | 429 | begin |
420 | 430 | (if (List.length fns_included) > 0 then |
@@ -566,7 +576,12 @@ let analyze_arm starttime = |
566 | 576 | faddr#toPretty; |
567 | 577 | STR ": "; |
568 | 578 | p]); |
569 | | - failedfunctions := faddr :: !failedfunctions |
| 579 | + if system_settings#fail_on_function_failure then |
| 580 | + raise |
| 581 | + (BCH_failure |
| 582 | + (LBLOCK [STR "Function failure of "; faddr#toPretty; STR ": "; p])) |
| 583 | + else |
| 584 | + failedfunctions := faddr :: !failedfunctions |
570 | 585 | end in |
571 | 586 | begin |
572 | 587 | (if (List.length fns_included) > 0 then |
@@ -606,9 +621,11 @@ let analyze_arm starttime = |
606 | 621 | pr_interval_timing [STR "functions analyzed: "; INT !count] 60.0 |
607 | 622 | with |
608 | 623 | | Failure s -> functionfailure "Failure" faddr (STR s) |
609 | | - | Invalid_argument s -> functionfailure "Invalid argument" faddr (STR s) |
| 624 | + | Invalid_argument s -> |
| 625 | + functionfailure "Invalid argument" faddr (STR s) |
610 | 626 | | Internal_error s -> functionfailure "Internal error" faddr (STR s) |
611 | | - | Invocation_error s -> functionfailure "Invocation error" faddr (STR s) |
| 627 | + | Invocation_error s -> |
| 628 | + functionfailure "Invocation error" faddr (STR s) |
612 | 629 | | CHFailure p -> functionfailure "CHFailure" faddr p |
613 | 630 | | BCH_failure p -> functionfailure "BCHFailure" faddr p)); |
614 | 631 | file_metrics#record_runtime ((Unix.gettimeofday ()) -. starttime) |
|
0 commit comments