3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 06:03:23 +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:
Daniel Peebles 2020-04-28 19:54:31 -07:00 committed by GitHub
parent a11dc5d3b5
commit 7e34925035
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 9 deletions

View file

@ -49,6 +49,7 @@ char const * z3_error::msg() const {
case ERR_INTERNAL_FATAL: return "internal error";
case ERR_TYPE_CHECK: return "type error";
case ERR_ALLOC_EXCEEDED: return "number of configured allocations exceeded";
case ERR_UNREACHABLE: return "unreachable code was reached";
default: return "unknown error";
}
}