* 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:
Alexandre Duret-Lutz 2004-11-08 14:43:10 +00:00
parent 86ff462fa4
commit 7afd10420a
3 changed files with 20 additions and 2 deletions

View file

@ -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;