shithub: mc

Download patch

ref: 393d51ef77ae250ca5552ef985b14c790483ee24
parent: f9b54e1fcf403c9c8386133f1482b2fc315e8ae1
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Dec 16 17:45:25 EST 2015

Mark vararg args as reflected correctly.

--- a/6/simp.c
+++ b/6/simp.c
@@ -1198,8 +1198,10 @@
 	 * We want to start at variadic, so we want
 	 * to count from ft->nsub - 1, up to n->expr.nsub.
 	 */
-	for (i = ft->nsub - 1; i < n->expr.nargs; i++)
+	for (i = ft->nsub - 1; i < n->expr.nargs; i++) {
+		exprtype(n->expr.args[i])->isreflect = 1;
 		lappend(&st, &nst, exprtype(n->expr.args[i]));
+	}
 	vt = mktytuple(n->loc, st, nst);
 	vt->isreflect = 1;
 
--- a/parse/type.c
+++ b/parse/type.c
@@ -209,7 +209,6 @@
 	t->traits = bsdup(base->traits);
 	t->sub = xalloc(sizeof(Type *));
 	t->sub[0] = base;
-	t->isreflect = 1;
 	return t;
 }