diff --git a/src/regex_impl.hh b/src/regex_impl.hh index 67d6f38b..f6f79baf 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -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(thread.saves->pos); } - const size_t index = *thread.inst++; thread.saves->pos[index] = pos.base(); break; }