mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 20:05:51 +00:00
Improve UX for unreachable/unimplemented errors (#4094)
This should replace several "segfaults" and "illegal instruction" errors with messages that contain a bit more context. I also put in a link to the bug tracker to make users' lives a bit easier. For context, `__builtin_unreachable`'s behavior is undefined and is intended only as a mechanism to help the compiler see that code will not return. I do still include it in the new code because if I don't, compilation produces a lot more warnings as it can't see that `NOT_IMPLEMENTED_YET` and `UNREACHABLE` cannot return.
This commit is contained in:
parent
a11dc5d3b5
commit
7e34925035
4 changed files with 23 additions and 9 deletions
|
@ -23,6 +23,7 @@ Revision History:
|
|||
#include<iostream>
|
||||
#include "util/str_hashtable.h"
|
||||
#include "util/z3_exception.h"
|
||||
#include "util/z3_version.h"
|
||||
|
||||
static volatile bool g_enable_assertions = true;
|
||||
|
||||
|
@ -39,6 +40,10 @@ void notify_assertion_violation(const char * fileName, int line, const char * co
|
|||
std::cerr << "File: " << fileName << "\n";
|
||||
std::cerr << "Line: " << line << "\n";
|
||||
std::cerr << condition << "\n";
|
||||
#ifndef Z3DEBUG
|
||||
std::cerr << Z3_FULL_VERSION << "\n";
|
||||
std::cerr << "Please file an issue with this message and more detail about how you encountered it at https://github.com/Z3Prover/z3/issues/new\n";
|
||||
#endif
|
||||
}
|
||||
|
||||
static str_hashtable* g_enabled_debug_tags = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue