hoa: fix segfault when input has initial alternation

* src/hoaparse/hoaparse.yy: Do not check initial alternating state
number until we support alternation.
* src/tests/hoaparse.test: Add a test case.
This commit is contained in:
Alexandre Duret-Lutz 2015-05-04 22:03:08 +02:00
parent a4b63e8e7f
commit e83bfd37a4
2 changed files with 65 additions and 1 deletions

View file

@ -428,7 +428,7 @@ header-item: "States:" INT
}
res.states = std::max(res.states, (int) $2);
}
| "Start:" state-conj-2
| "Start:" init-state-conj-2
{
error(@2, "alternation is not yet supported");
YYABORT;
@ -587,6 +587,11 @@ header-spec: | header-spec BOOLEAN
state-conj-2: checked-state-num '&' checked-state-num
| state-conj-2 '&' checked-state-num
// Currently we do not check the number of these states
// since we do not support alternation.
init-state-conj-2: state-num '&' state-num
| init-state-conj-2 '&' state-num
label-expr: 't'
{
$$ = bddtrue.id();