* src/tgbaparse/tgbaparse.yy: Add `%destructor's so the parser
does not leak on errors. * src/tgbatest/ltl2tgba.cc: Free the automata if it could not be fully parsed.
This commit is contained in:
parent
86ff462fa4
commit
7afd10420a
3 changed files with 20 additions and 2 deletions
|
|
@ -1,5 +1,10 @@
|
|||
2004-11-08 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||
|
||||
* src/tgbaparse/tgbaparse.yy: Add `%destructor's so the parser
|
||||
does not leak on errors.
|
||||
* src/tgbatest/ltl2tgba.cc: Free the automata if it could not be
|
||||
fully parsed.
|
||||
|
||||
* src/tgbaalgos/gtec/ce.cc (couvreur99_check_result::accepting_run):
|
||||
Remove spurious FIXME.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
/* Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
** département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
** et Marie Curie.
|
||||
**
|
||||
|
|
@ -63,6 +63,15 @@ typedef std::pair<bool, spot::ltl::formula*> pair;
|
|||
%type <list> acc_list
|
||||
%token ACC_DEF
|
||||
|
||||
%destructor { delete $$; } STRING UNTERMINATED_STRING IDENT strident string
|
||||
%destructor { spot::ltl::destroy($$); } condition
|
||||
%destructor {
|
||||
for (std::list<spot::ltl::formula*>::iterator i = $$->begin();
|
||||
i != $$->end(); ++i)
|
||||
spot::ltl::destroy(*i);
|
||||
delete $$;
|
||||
} acc_list
|
||||
|
||||
%%
|
||||
tgba: acceptance_decl lines | lines;
|
||||
|
||||
|
|
|
|||
|
|
@ -410,7 +410,11 @@ main(int argc, char** argv)
|
|||
spot::tgba_explicit* e;
|
||||
to_free = a = e = spot::tgba_parse(input, pel, dict, env, debug_opt);
|
||||
if (spot::format_tgba_parse_errors(std::cerr, pel))
|
||||
{
|
||||
delete to_free;
|
||||
delete dict;
|
||||
return 2;
|
||||
}
|
||||
e->merge_transitions();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue