summaryrefslogtreecommitdiff
path: root/src/main/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/util.cpp')
-rw-r--r--src/main/util.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/main/util.cpp b/src/main/util.cpp
index eb360818b..bf42025a0 100644
--- a/src/main/util.cpp
+++ b/src/main/util.cpp
@@ -51,8 +51,8 @@ bool segvNoSpin = false;
/** Handler for SIGXCPU, i.e., timeout. */
void timeout_handler(int sig, siginfo_t* info, void*) {
fprintf(stderr, "CVC4 interrupted by timeout.\n");
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
abort();
}
@@ -60,8 +60,8 @@ void timeout_handler(int sig, siginfo_t* info, void*) {
/** Handler for SIGINT, i.e., when the user hits control C. */
void sigint_handler(int sig, siginfo_t* info, void*) {
fprintf(stderr, "CVC4 interrupted by user.\n");
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
abort();
}
@@ -85,8 +85,8 @@ void segv_handler(int sig, siginfo_t* info, void* c) {
if(segvNoSpin) {
fprintf(stderr, "No-spin requested, aborting...\n");
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
abort();
} else {
@@ -105,8 +105,8 @@ void segv_handler(int sig, siginfo_t* info, void* c) {
} else if(addr < 10*1024) {
cerr << "Looks like a NULL pointer was dereferenced." << endl;
}
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
abort();
#endif /* CVC4_DEBUG */
@@ -118,8 +118,8 @@ void ill_handler(int sig, siginfo_t* info, void*) {
fprintf(stderr, "CVC4 executed an illegal instruction in DEBUG mode.\n");
if(segvNoSpin) {
fprintf(stderr, "No-spin requested, aborting...\n");
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
abort();
} else {
@@ -131,8 +131,8 @@ void ill_handler(int sig, siginfo_t* info, void*) {
}
#else /* CVC4_DEBUG */
fprintf(stderr, "CVC4 executed an illegal instruction.\n");
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
abort();
#endif /* CVC4_DEBUG */
@@ -155,8 +155,8 @@ void cvc4unexpected() {
}
if(segvNoSpin) {
fprintf(stderr, "No-spin requested.\n");
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
set_terminate(default_terminator);
} else {
@@ -168,8 +168,8 @@ void cvc4unexpected() {
}
#else /* CVC4_DEBUG */
fprintf(stderr, "CVC4 threw an \"unexpected\" exception.\n");
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
set_terminate(default_terminator);
#endif /* CVC4_DEBUG */
@@ -181,16 +181,16 @@ void cvc4terminate() {
"CVC4 was terminated by the C++ runtime.\n"
"Perhaps an exception was thrown during stack unwinding. "
"(Don't do that.)\n");
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
default_terminator();
#else /* CVC4_DEBUG */
fprintf(stderr,
"CVC4 was terminated by the C++ runtime.\n"
"Perhaps an exception was thrown during stack unwinding.\n");
- if(options.statistics) {
- StatisticsRegistry::flushStatistics(cerr);
+ if(options.statistics && pStatistics != NULL) {
+ pStatistics->flushStatistics(cerr);
}
default_terminator();
#endif /* CVC4_DEBUG */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback