shithub: mc

Download patch

ref: 4121d26d2915e65e517a4bfb0b401b41349fdaa5
parent: 3fb4e8e6ab0ec8c1b29a97c4d260d2a030055bf6
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Dec 18 18:31:43 EST 2015

Don't introduce loops in the match trie.

--- a/mi/match.c
+++ b/mi/match.c
@@ -257,6 +257,8 @@
 	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) {