From 659c2195d2c224122cc8da813bec3af46084b61b Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 21 Jul 2023 16:20:00 +0800 Subject: regex: Merge the `types` array as well. * nfa/src/default/regex.rs: Previously when merging regular expressoins, only the graphs are merged, but the `types` array stayed unchanged. This caused errors of indices being out of bounds. --- nfa/src/default/regex.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nfa/src/default') diff --git a/nfa/src/default/regex.rs b/nfa/src/default/regex.rs index 9b5fab1..8185ca5 100644 --- a/nfa/src/default/regex.rs +++ b/nfa/src/default/regex.rs @@ -558,6 +558,8 @@ impl DefaultRegex { builder_mut.append(other.graph); + self.types.extend(other.types); + if let Some(root) = self.root { // Deliberately ignore errors here. let _ = builder_mut.add_edge(root, old_len, ()); -- cgit v1.2.3-18-g5258