summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-04 01:09:33 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-04 01:09:33 -0700
commit4926b4adbe014b44c483c8f65daf6fe6f914de44 (patch)
treef14779be52aa818b240e2633f89b5ce83e008091 /parse
parentb27a29176ad1c863b4ba5b1813c06c6d4fd2983d (diff)
downloadmc-4926b4adbe014b44c483c8f65daf6fe6f914de44.tar.gz
Fix a bug detected by scan-build.
Diffstat (limited to 'parse')
-rw-r--r--parse/infer.c1
-rw-r--r--parse/stab.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/parse/infer.c b/parse/infer.c
index cd0e940..1006a3d 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -903,6 +903,7 @@ static Type *unify(Inferstate *st, Node *ctx, Type *u, Type *v)
typeerror(st, a, b, ctx, "Incompatible parameter lists");
for (i = 0; i < a->narg; i++)
unify(st, ctx, a->arg[i], b->arg[i]);
+ r = b;
} else if (a->type != Tyvar) {
typeerror(st, a, b, ctx, NULL);
}
diff --git a/parse/stab.c b/parse/stab.c
index a8c11ee..ca68d63 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -304,6 +304,7 @@ void puttype(Stab *st, Node *n, Type *t)
Tydefn *td;
Type *ty;
+ assert(t != NULL);
if (st->name)
setns(n, st->name);
if (st->name && t && t->name)