fix(frontends/lean): unprotected call to Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
411f14415d
commit
65bdb9c7e0
3 changed files with 10 additions and 3 deletions
|
@ -844,11 +844,10 @@ tactic parser_imp::parse_tactic_expr() {
|
|||
if (curr() == scanner::token::ScriptBlock) {
|
||||
parse_script_expr();
|
||||
return using_script([&](lua_State * L) {
|
||||
try {
|
||||
if (is_tactic(L, -1))
|
||||
return to_tactic(L, -1);
|
||||
} catch (...) {
|
||||
else
|
||||
throw parser_error("invalid script-block, it must return a tactic", p);
|
||||
}
|
||||
});
|
||||
} else if (curr_is_identifier() && m_tactic_macros && m_tactic_macros->find(curr_name()) != m_tactic_macros->end()) {
|
||||
return parse_tactic_macro(curr_name(), p);
|
||||
|
|
2
tests/lean/tacluacrash.lean
Normal file
2
tests/lean/tacluacrash.lean
Normal file
|
@ -0,0 +1,2 @@
|
|||
theorem T (a : Bool) : a → a.
|
||||
(* foo_tac *)
|
6
tests/lean/tacluacrash.lean.expected.out
Normal file
6
tests/lean/tacluacrash.lean.expected.out
Normal file
|
@ -0,0 +1,6 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
tacluacrash.lean:2:0: error: invalid script-block, it must return a tactic
|
||||
tacluacrash.lean:3:0: error: invalid tactic command, unexpected end of file
|
||||
Proof state:
|
||||
a : Bool, H : a ⊢ a
|
Loading…
Reference in a new issue