Commit 1e841705 authored by Mikaël Salson's avatar Mikaël Salson

automaton.hpp: Don't overwrite informations in automaton

When transferring information we may overwrite them. We need to take into
account the case where the destination state already has some information stored.
parent f9db7c63
......@@ -137,7 +137,16 @@ void PointerACAutomaton<Info>::build_failure_functions() {
pointer_state<Info> *failed_state = couple.second;
if (failed_state->is_final) {
current_state->is_final = true;
current_state->informations = failed_state->informations;
if (! current_state->informations.front().isNull()) {
if (! this->multiple_info)
current_state->informations.front() += failed_state->informations.front();
else
current_state->informations.insert(current_state->informations.end(),
failed_state->informations.begin(),
failed_state->informations.end());
} else {
current_state->informations = failed_state->informations;
}
}
for (size_t i = 0; i < NB_TRANSITIONS; i++) {
if (current_state->transitions[i] != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment