summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-18 23:31:43 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-18 23:31:43 -0800
commit4121d26d2915e65e517a4bfb0b401b41349fdaa5 (patch)
tree6dc766f22bcfa316c39952fd0ec9f56fb9a8155f /mi
parent3fb4e8e6ab0ec8c1b29a97c4d260d2a030055bf6 (diff)
downloadmc-4121d26d2915e65e517a4bfb0b401b41349fdaa5.tar.gz
Don't introduce loops in the match trie.
Diffstat (limited to 'mi')
-rw-r--r--mi/match.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mi/match.c b/mi/match.c
index f06d4f3..d967fa3 100644
--- a/mi/match.c
+++ b/mi/match.c
@@ -257,6 +257,8 @@ static int addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree *
ntail = 0;
ty = tybase(ty);
if (istyprimitive(ty) || ty->type == Tyvoid) {
+ if (start == accept)
+ return 0;
for (i = 0; i < start->nnext; i++)
lappend(end, nend, start->next[i]);
if (start->any) {