From b85d8c89cef68c80faf6d7ba3ffc048e58aa6f5b Mon Sep 17 00:00:00 2001 From: yhirose Date: Wed, 17 Mar 2021 09:48:43 -0400 Subject: [PATCH] Fix #158 --- peglib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/peglib.h b/peglib.h index b8f2631..c034d13 100644 --- a/peglib.h +++ b/peglib.h @@ -3732,9 +3732,9 @@ private: if (!ret) { return nullptr; } // Check infinite loop - for (auto &[name, rule] : grammar) { - DetectInfiniteLoop vis(rule.s_, name); - rule.accept(vis); + { + DetectInfiniteLoop vis(data.start_pos, data.start); + start_rule.accept(vis); if (vis.has_error) { if (log) { auto line = line_info(s, vis.error_s);