parsetl: fix crash in debug-mode

Fixes #193, reported by Etienne Renault.

* spot/parsetl/parsetl.yy: Clone printed formulas.
* tests/core/parse.test: Add test case.
* NEWS: Mention the issue.
This commit is contained in:
Alexandre Duret-Lutz 2016-10-29 13:13:09 +02:00
parent a5fb5784f6
commit 40ed12050b
3 changed files with 9 additions and 4 deletions

2
NEWS
View file

@ -31,6 +31,8 @@ New in spot 2.1.2.dev (not yet released)
* str_sere() and str_utf8_sere() were not returning the same * str_sere() and str_utf8_sere() were not returning the same
string that print_sere() and print_utf8_sere() would print. string that print_sere() and print_utf8_sere() would print.
* Running the LTL parser in debug-mode would crash.
New in spot 2.1.2 (2016-10-14) New in spot 2.1.2 (2016-10-14)
Command-line tools: Command-line tools:

View file

@ -236,8 +236,8 @@ using namespace spot;
%destructor { $$->destroy(); } <ltl> %destructor { $$->destroy(); } <ltl>
%printer { debug_stream() << *$$; } <str> %printer { debug_stream() << *$$; } <str>
%printer { print_psl(debug_stream(), formula($$)); } <ltl> %printer { print_psl(debug_stream(), formula($$->clone())); } <ltl>
%printer { print_sere(debug_stream(), formula($$)); } sere bracedsere %printer { print_sere(debug_stream(), formula($$->clone())); } sere bracedsere
%printer { debug_stream() << $$; } <num> %printer { debug_stream() << $$; } <num>
%printer { debug_stream() << $$.min << ".." << $$.max; } <minmax> %printer { debug_stream() << $$.min << ".." << $$.max; } <minmax>

View file

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2011, 2012, 2013 Laboratoire de Recherche # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2016 Laboratoire de
# et Développement de l'Epita (LRDE). # Recherche et Développement de l'Epita (LRDE).
# Copyright (C) 2003, 2004 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 # département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie. # et Marie Curie.
@ -104,3 +104,6 @@ do
fi fi
fi fi
done done
# Make sure running the parser in debug mode does not crash
run 0 ../ikwiad -d 'a U b'