mirror of
https://github.com/Z3Prover/z3
synced 2025-04-11 19:53:34 +00:00
set undo trail after set-watches to avoid crash during exception handling (the relevancy trail is scoped so ends up traversing the trail if allocating the watch throws an exception). Fixes crash.smt in issue #56
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
0eaaafc79d
commit
108d76270e
|
@ -212,8 +212,8 @@ namespace smt {
|
|||
return;
|
||||
case l_undef:
|
||||
SASSERT(eh);
|
||||
push_trail(eh_trail(n, val));
|
||||
set_watches(n, val, new (get_region()) relevancy_ehs(eh, get_watches(n, val)));
|
||||
push_trail(eh_trail(n, val));
|
||||
break;
|
||||
case l_true:
|
||||
eh->operator()(*this, n, val);
|
||||
|
|
|
@ -69,6 +69,12 @@ static void throw_out_of_memory() {
|
|||
}
|
||||
|
||||
static void throw_alloc_counts_exceeded() {
|
||||
#pragma omp critical (z3_memory_manager)
|
||||
{
|
||||
// reset the count to avoid re-throwing while
|
||||
// the exception is being thrown.
|
||||
g_memory_alloc_count = 0;
|
||||
}
|
||||
throw exceeded_memory_allocations();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue