aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cparser/Cerrors.ml25
1 files changed, 13 insertions, 12 deletions
diff --git a/cparser/Cerrors.ml b/cparser/Cerrors.ml
index e7b21dbb..c8fc65db 100644
--- a/cparser/Cerrors.ml
+++ b/cparser/Cerrors.ml
@@ -323,17 +323,18 @@ let raise_on_errors () =
raise Abort
let crash exn =
- if Version.buildnr <> "" && Version.tag <> "" then begin
- eprintf "%tThis is CompCert, Release:%s, Build:%s, Tag:%s%t\n"
- bc Version.version Version.buildnr Version.tag rsc;
- eprintf "Backtrace (please include this in your support request):\n%s"
- (Printexc.get_backtrace ());
- eprintf "%tUncaught exception:%s.\n\
+ if Version.buildnr <> "" && Version.tag <> "" then begin
+ let backtrace = Printexc.get_backtrace () in
+ eprintf "%tThis is CompCert, Release:%s, Build:%s, Tag:%s%t\n"
+ bc Version.version Version.buildnr Version.tag rsc;
+ eprintf "Backtrace (please include this in your support request):\n%s"
+ backtrace;
+ eprintf "%tUncaught exception:%s.\n\
\ Please report this problem to our support.\n\
\ Error occurred in Build: %s, Tag: %s.\n%t"
- rc (Printexc.to_string exn) Version.buildnr Version.tag rsc;
- exit 2
- end else begin
- Printexc.print_backtrace stderr;
- exit 2
- end
+ rc (Printexc.to_string exn) Version.buildnr Version.tag rsc;
+ exit 2
+ end else begin
+ Printexc.print_backtrace stderr;
+ exit 2
+ end