From 8228d4f959c2211d1840928d1cfc349ce2820200 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 8 Aug 2016 10:37:53 +0200 Subject: Added error check before transformations. Added a check for errors after the elab phases to avoid problems in the transformations due to broken input programs. Bug 19504 --- cparser/Cerrors.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cparser/Cerrors.ml') diff --git a/cparser/Cerrors.ml b/cparser/Cerrors.ml index 5c077f37..0667ea16 100644 --- a/cparser/Cerrors.ml +++ b/cparser/Cerrors.ml @@ -30,7 +30,7 @@ exception Abort to print its message, as opposed to [Format], and does not automatically introduce indentation and a final dot into the message. This is useful for multi-line messages. *) - + let fatal_error_raw fmt = incr num_errors; Printf.kfprintf @@ -67,4 +67,6 @@ let check_errors () = (if !num_warnings = 1 then "" else "s"); !num_errors > 0 || (!warn_error && !num_warnings > 0) - +let raise_on_errors () = + if !num_warnings > 0 || (!warn_error && !num_warnings > 0) then + raise Abort -- cgit From 6c70ceb179798478f29efda5358c4660c38b7392 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 8 Aug 2016 12:50:44 +0200 Subject: Fixed typo. Bug 19504 --- cparser/Cerrors.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cparser/Cerrors.ml') diff --git a/cparser/Cerrors.ml b/cparser/Cerrors.ml index 0667ea16..a4d1a3f8 100644 --- a/cparser/Cerrors.ml +++ b/cparser/Cerrors.ml @@ -68,5 +68,5 @@ let check_errors () = !num_errors > 0 || (!warn_error && !num_warnings > 0) let raise_on_errors () = - if !num_warnings > 0 || (!warn_error && !num_warnings > 0) then + if !num_errors > 0 || (!warn_error && !num_warnings > 0) then raise Abort -- cgit