with --stats, statistics are dumped for memouts and (normal) exceptions.
authorMorgan Deters <mdeters@gmail.com>
Tue, 12 Oct 2010 22:08:54 +0000 (22:08 +0000)
committerMorgan Deters <mdeters@gmail.com>
Tue, 12 Oct 2010 22:08:54 +0000 (22:08 +0000)
src/main/main.cpp

index f78637d8263fc2794510577bc9ad5d2b22eb8f90..d879e81dffce20b39427228f62e760261b9485da 100644 (file)
@@ -73,12 +73,18 @@ int main(int argc, char* argv[]) {
     cout << "unknown" << endl;
 #endif
     cerr << "CVC4 Error:" << endl << e << endl;
+    if(options.statistics) {
+      StatisticsRegistry::flushStatistics(cerr);
+    }
     exit(1);
   } catch(bad_alloc) {
 #ifdef CVC4_COMPETITION_MODE
     cout << "unknown" << endl;
 #endif
     cerr << "CVC4 ran out of memory." << endl;
+    if(options.statistics) {
+      StatisticsRegistry::flushStatistics(cerr);
+    }
     exit(1);
   } catch(...) {
 #ifdef CVC4_COMPETITION_MODE
@@ -224,7 +230,7 @@ int runCvc4(int argc, char* argv[]) {
   ReferenceStat< Result > s_statSatResult("sat/unsat", result);
   StatisticsRegistry::registerStat(&s_statSatResult);
 
-  if(options.statistics){
+  if(options.statistics) {
     StatisticsRegistry::flushStatistics(cerr);
   }