Regex: Fix handling of Save instruction in ThreadedRegexVM

When not saving, we were not fully reading the instruction stream,
leading to an out of sync instruction pointer.
This commit is contained in:
Maxime Coste 2017-10-04 22:31:15 +08:00
parent f1b4931824
commit 854144c535

View File

@ -171,6 +171,7 @@ struct ThreadedRegexVM
}
case CompiledRegex::Save:
{
const size_t index = *thread.inst++;
if (thread.saves == nullptr)
break;
if (thread.saves->refcount > 1)
@ -178,7 +179,6 @@ struct ThreadedRegexVM
--thread.saves->refcount;
thread.saves = new_saves<true>(thread.saves->pos);
}
const size_t index = *thread.inst++;
thread.saves->pos[index] = pos.base();
break;
}