feat(kernel/max_sharing): check for imminent stack overflows and interruptions in the expression sharing maximizer
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
2089b85532
commit
95b6e61738
2 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,7 @@ Author: Leonardo de Moura
|
|||
#include <unordered_set>
|
||||
#include <functional>
|
||||
#include "util/buffer.h"
|
||||
#include "util/interrupt.h"
|
||||
#include "kernel/max_sharing.h"
|
||||
|
||||
namespace lean {
|
||||
|
@ -33,6 +34,7 @@ struct max_sharing_fn::imp {
|
|||
}
|
||||
|
||||
expr apply(expr const & a) {
|
||||
check_system("max_sharing");
|
||||
auto r = m_cache.find(a);
|
||||
if (r != m_cache.end()) {
|
||||
lean_assert((*r).raw()->max_shared());
|
||||
|
|
|
@ -29,7 +29,6 @@ public:
|
|||
void clear();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
\brief The resultant expression is structurally identical to the input one, but
|
||||
it uses maximally shared sub-expressions.
|
||||
|
|
Loading…
Reference in a new issue