From 9ebbbeaac387a7eae07dfcd383c011ab9d813d96 Mon Sep 17 00:00:00 2001 From: xiw Date: Sat, 14 Nov 2009 08:47:40 +0000 Subject: [PATCH] fixed a crash in parser. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@404 e59a4935-1847-0410-ae03-e826735625c1 --- src/parser/CVC.y | 6 ++++++ src/parser/smtlib.y | 1 + tests/c-api-tests/Makefile | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parser/CVC.y b/src/parser/CVC.y index b12e3d1..c2e443d 100644 --- a/src/parser/CVC.y +++ b/src/parser/CVC.y @@ -174,7 +174,13 @@ %% cmd : other_cmd +{ + _parser_symbol_table.clear(); +} | other_cmd counterexample +{ + _parser_symbol_table.clear(); +} ; counterexample : COUNTEREXAMPLE_TOK ';' diff --git a/src/parser/smtlib.y b/src/parser/smtlib.y index 07c46a8..7166cab 100644 --- a/src/parser/smtlib.y +++ b/src/parser/smtlib.y @@ -227,6 +227,7 @@ benchmark ((ASTVec*)AssertsQuery)->push_back(assumptions); ((ASTVec*)AssertsQuery)->push_back(query); delete $1; + _parser_symbol_table.clear(); YYACCEPT; } ; diff --git a/tests/c-api-tests/Makefile b/tests/c-api-tests/Makefile index cbcc687..01447da 100644 --- a/tests/c-api-tests/Makefile +++ b/tests/c-api-tests/Makefile @@ -32,7 +32,7 @@ all: 0 1 2 3 4 5 6 7 8 9 10 11 11 12 13 14 15 16 17 18 19 20 ./a4.out 5: g++ $(CXXFLAGS) parsefile-using-cinterface.c -lstp -o a5.out - #./a5.out + ./a5.out 6: g++ $(CXXFLAGS) print.c -lstp -o a6.out ./a6.out -- 2.47.3