summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2020-02-23 19:53:25 -0300
committerSoniEx2 <endermoneymod@gmail.com>2020-02-23 19:53:25 -0300
commit621203d3239adf80fea769eda93f727cc6f4ac5a (patch)
treecfadb3cd191d1af529af6775b8b2f3491b7a1f59
parente122005c39752197c722708a363236b20d38c666 (diff)
Fix infinite matches on empty patterns
-rw-r--r--abdl/_vm.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/abdl/_vm.py b/abdl/_vm.py
index 1de2e15..f8b8c80 100644
--- a/abdl/_vm.py
+++ b/abdl/_vm.py
@@ -289,7 +289,8 @@ def match_helper(ops, defs, tree):
                     res[h.name] = (h.key, h.value)
             yield res
             assert len(path) == 1 or isinstance(frame.current_op, End)
-            frame.prev()
+            if not frame.prev():
+                return
             in_key = True
         else:
             if in_key: