Z3 sometimes reports two errors, with the first one referring to line 1 for some strange reason -- but it makes no sense to kill line 1, so we traverse the errors in reverse and consider only the last error
authorblanchet
Fri, 17 Dec 2010 11:12:37 +0100
changeset 41237 8b6f3917bc76
parent 41236 def0a3013554
child 41238 78e4508d2e54
Z3 sometimes reports two errors, with the first one referring to line 1 for some strange reason -- but it makes no sense to kill line 1, so we traverse the errors in reverse and consider only the last error
src/HOL/Tools/SMT/lib/scripts/z3_wrapper
--- a/src/HOL/Tools/SMT/lib/scripts/z3_wrapper	Fri Dec 17 09:56:04 2010 +0100
+++ b/src/HOL/Tools/SMT/lib/scripts/z3_wrapper	Fri Dec 17 11:12:37 2010 +0100
@@ -29,7 +29,7 @@
 print STDERR join("", @err_lines);
 
 if ($code != 0) {
-  foreach my $err_line (@err_lines) {
+  foreach my $err_line (reverse(@err_lines)) {
     if ($err_line =~ /[lL]ine ([0-9]+)/) {
       my $line_num = $1;