fix(kernel/expr): make sure we cannot create a free variable with index uint_max, reason: get_free_var_range would return an incorrect value
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
3712da0b54
commit
cb479a75ae
1 changed files with 4 additions and 1 deletions
|
@ -79,7 +79,10 @@ void expr_cell::set_is_arrow(bool flag) {
|
|||
// Expr variables
|
||||
expr_var::expr_var(unsigned idx):
|
||||
expr_cell(expr_kind::Var, idx, false, false, false),
|
||||
m_vidx(idx) {}
|
||||
m_vidx(idx) {
|
||||
if (idx == std::numeric_limits<unsigned>::max())
|
||||
throw exception("invalid free variable index, de Bruijn index is too big");
|
||||
}
|
||||
|
||||
// Expr constants
|
||||
expr_const::expr_const(name const & n, levels const & ls):
|
||||
|
|
Loading…
Reference in a new issue