summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-10-19 12:22:46 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-19 12:22:46 -0700
commitfc4fca0fa6c64a0fbe6fbb5c8faf1e5640b784ea (patch)
treeda93cf035494d349321da558b872360efe7f0adf
parent4770743d640a13ae81110b4161f0eb6eff9c0be1 (diff)
downloadmc-fc4fca0fa6c64a0fbe6fbb5c8faf1e5640b784ea.tar.gz
If we haven't installed the proto, use the one we have.
-rw-r--r--parse/use.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/parse/use.c b/parse/use.c
index cb0a2cd..d446503 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -856,8 +856,9 @@ protomap(Trait *tr, Type *ty, Node *dcl)
dclname = declname(dcl);
for (i = 0; i < tr->nproto; i++) {
- proto = tr->proto[i];
- proto = getdcl(curstab(), proto->decl.name);
+ proto = getdcl(curstab(), tr->proto[i]->decl.name);
+ if (!proto)
+ proto = tr->proto[i];
protoname = declname(proto);
len = strlen(protoname);
p = strstr(dclname, protoname);