summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-24 23:38:37 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-24 23:38:37 -0800
commitbf24b946be8f54d58030fe143453b269175b3461 (patch)
tree5fb5b0580949c19b3a576c6f8b6155ef5bca9474 /mi
parenta8935c73459f261ab58b80d4c3936910181813cd (diff)
downloadmc-bf24b946be8f54d58030fe143453b269175b3461.tar.gz
Handle the other branch for pointers.
Diffstat (limited to 'mi')
-rw-r--r--mi/match.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mi/match.c b/mi/match.c
index 22d363f..5f15d41 100644
--- a/mi/match.c
+++ b/mi/match.c
@@ -341,8 +341,13 @@ static int addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree *
break;
case Typtr:
/* we only want to descend if there's something to match here. */
- if (start->any || start->nnext > 0)
+ if (start->any || start->nnext > 0) {
ret = addwildrec(loc, ty->sub[0], start, accept, &last, &nlast);
+ } else if (!start->any) {
+ start->any = accept;
+ lappend(end, nend, accept);
+ return 1;
+ }
break;
default:
ret = 1;