From 03e911d5e434eecd1a17a8dee8bc20940d4b12c2 Mon Sep 17 00:00:00 2001 From: Lukas Holik Date: Thu, 28 Sep 2023 14:15:37 +0200 Subject: [PATCH] tf's review --- src/nfa/intersection.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nfa/intersection.cc b/src/nfa/intersection.cc index bc79d79c8..55426026b 100644 --- a/src/nfa/intersection.cc +++ b/src/nfa/intersection.cc @@ -40,6 +40,9 @@ Nfa intersection(const Nfa& lhs, const Nfa& rhs, const Symbol first_epsilon, Pro return lhs.final.contains(lhs_state) && rhs.final.contains(rhs_state); }; + if (lhs.final.empty() || lhs.initial.empty() || rhs.initial.empty() || rhs.final.empty()) + return Nfa{}; + return algorithms::product(lhs, rhs, both_final, first_epsilon, prod_map); }