fix(library/tactic/exact_tactic): segfault when accessing head of empty list
closes #485
This commit is contained in:
parent
ac30052a29
commit
38a63a8a58
1 changed files with 8 additions and 4 deletions
|
@ -24,10 +24,14 @@ tactic exact_tactic(elaborate_fn const & elab, expr const & e, bool enforce_type
|
|||
if (auto new_e = elaborate_with_respect_to(env, ios, elab, new_s, e, some_expr(t),
|
||||
report_unassigned, enforce_type_during_elaboration)) {
|
||||
goals const & gs = new_s.get_goals();
|
||||
goal const & g = head(gs);
|
||||
substitution subst = new_s.get_subst();
|
||||
assign(subst, g, *new_e);
|
||||
return some(proof_state(new_s, tail(gs), subst));
|
||||
if (gs) {
|
||||
goal const & g = head(gs);
|
||||
substitution subst = new_s.get_subst();
|
||||
assign(subst, g, *new_e);
|
||||
return some(proof_state(new_s, tail(gs), subst));
|
||||
} else {
|
||||
return some_proof_state(new_s);
|
||||
}
|
||||
}
|
||||
return none_proof_state();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue