summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-07-31 00:31:10 -0400
committerOri Bernstein <ori@eigenstate.org>2012-07-31 00:31:10 -0400
commit03ac35586687e146835216f8339dbe31ead84d98 (patch)
tree673a787871f16e619e041526529ef15512483c9d
parentdf3dc5078c090ea2d9cef6c33cf157975d29bd4f (diff)
downloadmc-03ac35586687e146835216f8339dbe31ead84d98.tar.gz
Structs should be modeless.
-rw-r--r--8/isel.c2
-rw-r--r--8/simp.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/8/isel.c b/8/isel.c
index 8d098a6..d0b5685 100644
--- a/8/isel.c
+++ b/8/isel.c
@@ -71,7 +71,7 @@ static Mode mode(Node *n)
/* 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)
diff --git a/8/simp.c b/8/simp.c
index 786d428..d152c85 100644
--- a/8/simp.c
+++ b/8/simp.c
@@ -232,6 +232,7 @@ size_t tysize(Type *t)
return 4;
case Typtr: case Tyfunc:
+ case Tyvalist: /* ptr to first element of valist */
return Ptrsz;
case Tyint64: case Tylong:
@@ -243,11 +244,9 @@ size_t tysize(Type *t)
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: