diff options
author | Ori Bernstein <ori@eigenstate.org> | 2017-12-05 01:05:18 -0800 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2017-12-05 01:05:18 -0800 |
commit | 3360bf0e88b086b0c7f7957eeb4a6f0b4eaeebc7 (patch) | |
tree | 95aeb9f8bf85ca70dc9cbdb2729fe166303ca048 /mi | |
parent | 5aaf4d7e6e7eb9e55bf314a2db83ab25b834b4fb (diff) | |
download | mc-3360bf0e88b086b0c7f7957eeb4a6f0b4eaeebc7.tar.gz |
Shift the match frontier correctly.
Fixes #159
Diffstat (limited to 'mi')
-rw-r--r-- | mi/match.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -322,11 +322,11 @@ addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree ***end, size for (j = 0; j < nlast; j++) if (addwildrec(loc, ty->sub[i], last[j], next, &tail, &ntail)) ret = 1; - if (i == ty->nsub - 1) - break; lfree(&last, &nlast); last = tail; nlast = ntail; + if (i == ty->nsub - 1) + break; } break; case Tyarray: @@ -340,11 +340,11 @@ addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree ***end, size for (j = 0; j < nlast; j++) if (addwildrec(loc, ty->sub[0], last[j], next, &tail, &ntail)) ret = 1; - if (i == nelt - 1) - break; lfree(&last, &nlast); last = tail; nlast = ntail; + if (i == nelt - 1) + break; } break; case Tystruct: @@ -356,11 +356,11 @@ addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree ***end, size for (j = 0; j < nlast; j++) if (addwildrec(loc, decltype(ty->sdecls[i]), last[j], next, &tail, &ntail)) ret = 1; - if (i == ty->nsub - 1) - break; lfree(&last, &nlast); last = tail; nlast = ntail; + if (i == ty->nsub - 1) + break; } break; case Tyunion: |