Mercurial > hg > octave-nkf
diff libinterp/parse-tree/oct-parse.in.yy @ 17629:1e8f8900a041
clean up partially constructed parse tree objects on parse errors (bug #40231)
* oct-parse.in.yy (%destructor): New declaration of cleanup actions to
take for items on the parser stack when a parse error occurs.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 11 Oct 2013 09:05:54 -0400 |
parents | fd712a12fe53 |
children | bd0a84de3375 |
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy +++ b/libinterp/parse-tree/oct-parse.in.yy @@ -298,6 +298,13 @@ %right PLUS_PLUS MINUS_MINUS %left '(' '.' '{' +// How to clean up if there is a parse error. We handle deleting tokens +// and comments seperately and separators are just characters. The +// remaining items are dynamically allocated parse tree objects that +// must be deleted. +%destructor { } <sep_type> <tok_val> <comment_type> <dummy_type> <> +%destructor { delete $$; } <*> + // Where to start. %start input