Fix using patterns stored as table/set indices

Pattern values used as table/set indices are stored in serialized form
using just the pattern text, but re-creating the value from that didn't
fully initialize/compile the regex matcher after (re-)creating it from
that pattern text.
This commit is contained in:
Jon Siwek 2020-04-06 17:07:29 -07:00
parent e66148a13a
commit da56cd44d9
3 changed files with 56 additions and 0 deletions

View file

@ -891,6 +891,11 @@ const char* CompositeHash::RecoverOneVal(const HashKey* k, const char* kp0,
re = new RE_Matcher(kp1, kp1 + len[0]);
kp1 += len[0] + len[1];
}
if ( ! re->Compile() )
reporter->InternalError("failed compiling table/set key pattern: %s",
re->PatternText());
*pval = make_intrusive<PatternVal>(re);
}
break;