[GNA]Fix crash in gna_pluing when using POT (#16003)
This commit is contained in:
parent
dec425c408
commit
0a56927671
@ -148,15 +148,30 @@ private:
|
|||||||
inf_loop_count++;
|
inf_loop_count++;
|
||||||
} else {
|
} else {
|
||||||
if (inf_loop_count > 0 &&
|
if (inf_loop_count > 0 &&
|
||||||
(inf_loop_history.size() % inf_loop_pattern.size() == 0 || sf.allLayersProcessed()) &&
|
(inf_loop_pattern.size() > 0 && inf_loop_history.size() % inf_loop_pattern.size() == 0 ||
|
||||||
!std::equal(inf_loop_history.begin() + (inf_loop_history.size() - inf_loop_pattern.size()),
|
sf.allLayersProcessed())) {
|
||||||
|
int32_t history_shift = 0;
|
||||||
|
int32_t pattern_shift = 0;
|
||||||
|
|
||||||
|
if (inf_loop_history.size() > inf_loop_pattern.size()) {
|
||||||
|
history_shift = inf_loop_history.size() - inf_loop_pattern.size();
|
||||||
|
} else {
|
||||||
|
pattern_shift = inf_loop_pattern.size() - inf_loop_history.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!std::equal(inf_loop_history.begin() + history_shift,
|
||||||
inf_loop_history.end(),
|
inf_loop_history.end(),
|
||||||
inf_loop_pattern.begin())) {
|
inf_loop_pattern.begin() + pattern_shift)) {
|
||||||
inf_loop_count = 0;
|
inf_loop_count = 0;
|
||||||
|
log::debug() << "inf_loop_pattern:\n";
|
||||||
|
for (const auto& s : inf_loop_pattern) {
|
||||||
|
log::debug() << "\t " << s << '\n';
|
||||||
|
}
|
||||||
inf_loop_pattern.clear();
|
inf_loop_pattern.clear();
|
||||||
log::debug() << "infinite loop fixed\n";
|
log::debug() << "infinite loop fixed\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sf.SetInfiniteLoopCount(inf_loop_count);
|
sf.SetInfiniteLoopCount(inf_loop_count);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user