fix "input buffer overflow, can't enlarge buffer..."

This occured when parsing the HOA automaton generated by Rabinizer3 for
a very long LTL formula with many nested U.  State labels could easily
be more than 40k characters.

* src/parseaut/scanaut.ll: Fix that.
* src/tests/parseaut.test: New test case.
* NEWS: Mention the fix.
This commit is contained in:
Alexandre Duret-Lutz 2015-10-21 17:29:37 +02:00
parent 619b227eff
commit 64df4fbccc
3 changed files with 33 additions and 4 deletions

View file

@ -145,8 +145,8 @@ identifier [[:alpha:]_][[:alnum:]_-]*
"AP:" return token::AP;
"v2" return token::V2;
"explicit" return token::EXPLICIT;
"Comment:".* continue;
"//".* continue;
"Comment:".* yylloc->step();
"//".* yylloc->step();
"Acceptance-Pairs:" return token::ACCPAIRS;
"Acc-Sig:" return token::ACCSIG;
"---" return token::ENDOFHEADER;
@ -154,7 +154,9 @@ identifier [[:alpha:]_][[:alnum:]_-]*
/* The start of any automaton is the end of this one.
We do not try to detect LBTT automata, as that would
be too hard to distinguish from state numbers. */
""/{eols}("HOA:"|"never"|"DSA"|"DRA") {
{eols}("HOA:"|"never"|"DSA"|"DRA") {
yylloc->end = yylloc->begin;
yyless(0);
BEGIN(INITIAL);
return token::ENDDSTAR;
}
@ -281,7 +283,13 @@ identifier [[:alpha:]_][[:alnum:]_-]*
"*"+[^*/\n\r]* continue;
{eol} yylloc->lines(yyleng); yylloc->end.column = 1;
{eol2} yylloc->lines(yyleng / 2); yylloc->end.column = 1;
"*"+"/" if (--comment_level == 0) BEGIN(orig_cond);
"*"+"/" {
if (--comment_level == 0)
{
yylloc->step();
BEGIN(orig_cond);
}
}
<<EOF>> {
BEGIN(orig_cond);
error_list.push_back(

View file

@ -2365,3 +2365,21 @@ State: 3 "[{8}]"
[!1] 0 {0 1 2}
--END--
EOF
# A 50000-char word
BIGLABEL=`yes y | sed 25000q | tr 'y\n' 'xx'`
cat >bigaut <<EOF
HOA: v1
States: 1
Start: 0
Acceptance: 1 Fin(0)
AP: 0
--BODY--
State: 0 "$BIGLABEL"
{0}
[t] 0
--END--
EOF
# At some point, this crashed with
# input buffer overflow, can't enlarge buffer because scanner uses REJECT
run 0 ../../bin/autfilt -q bigaut