ref: 03ac35586687e146835216f8339dbe31ead84d98
parent: df3dc5078c090ea2d9cef6c33cf157975d29bd4f
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Jul 30 20:31:10 EDT 2012
Structs should be modeless.
--- a/8/isel.c
+++ b/8/isel.c
@@ -71,7 +71,7 @@
/* FIXME: huh. what should the mode for, say, structs
* be when we have no intention of loading /through/ the
* pointer? */
- return ModeQ;
+ return ModeNone;
}
static Loc *loc(Isel *s, Node *n)
--- a/8/simp.c
+++ b/8/simp.c
@@ -232,6 +232,7 @@
return 4;
case Typtr: case Tyfunc:
+ case Tyvalist: /* ptr to first element of valist */
return Ptrsz;
case Tyint64: case Tylong:
@@ -243,11 +244,9 @@
return 4;
case Tyfloat64:
return 8;
- case Tyvalist:
- return 4; /* ptr to first element of valist */
case Tyslice:
- return 8; /* len; ptr */
+ return 2*Ptrsz; /* len; ptr */
case Tyalias:
return tysize(t->sub[0]);
case Tyarray:
--
⑨