shithub: mc

Download patch

ref: 2b4787aec89f8d1dcd75c3dc022a8a137c5f5178
parent: f5a1454387098fa3abb7bf95f4123e1fac85cb7d
author: Ori Bernstein <[email protected]>
date: Mon Dec 14 18:47:17 EST 2015

Fix void arguments in argument lists.

	'void' isn't a bloody integer.

--- a/6/isel.c
+++ b/6/isel.c
@@ -78,7 +78,7 @@
 		}
 		break;
 	}
-	return ModeQ;
+	return ModeNone;
 }
 
 static Mode mode(Node *n)
@@ -950,8 +950,7 @@
 			htput(s->reglocs, arg, l);
 			nints++;
 		} else {
-			htput(s->stkoff, arg, itop(-(argoff + 2*Ptrsz)));
-			argoff += size(arg);
+			assert(tybase(decltype(arg))->type == Tyvoid);
 		}
 	}
 }
--- /dev/null
+++ b/test/voidarg.myr
@@ -1,0 +1,12 @@
+use std
+
+const main = {
+	var x : void
+	
+
+	std.put("{}\n", f(x, 1, void, 2))
+}
+
+const f = {v1, n1, v2, n2
+	-> n1 + n2
+}