summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-06-10 12:59:16 -0700
committerOri Bernstein <ori@eigenstate.org>2018-06-10 12:59:16 -0700
commit12da19e4d0545514a36f30bd7db39f428cfa67c5 (patch)
tree298784d9a4e4e8035350c8231cbdbc72dba4fae4
parentaed73f868fbd7b9774c25031893adda907a9558c (diff)
downloadmc-12da19e4d0545514a36f30bd7db39f428cfa67c5.tar.gz
Correctly float assignments inside function arguments.
-rw-r--r--lib/std/bigint.myr4
-rw-r--r--lib/std/bytealloc.myr1
-rw-r--r--mi/flatten.c6
3 files changed, 5 insertions, 6 deletions
diff --git a/lib/std/bigint.myr b/lib/std/bigint.myr
index 64b93ca..b574ce5 100644
--- a/lib/std/bigint.myr
+++ b/lib/std/bigint.myr
@@ -193,10 +193,6 @@ const bigbfmt = {buf, x, base
;;
n = 0
- if bigiszero(x)
- n += encode(buf[n:], '0')
- ;;
-
if base == 0
b = mkbigint(10)
else
diff --git a/lib/std/bytealloc.myr b/lib/std/bytealloc.myr
index b2f828f..4cd2b67 100644
--- a/lib/std/bytealloc.myr
+++ b/lib/std/bytealloc.myr
@@ -292,6 +292,7 @@ const mkslab = {bkt
die("Unable to get memory")
;;
+ b = Zchunk
s = (align((p : size), Slabsz) : slab#)
s.head = p
s.nfree = bkt.nper
diff --git a/mi/flatten.c b/mi/flatten.c
index fd1c389..fa4bdc1 100644
--- a/mi/flatten.c
+++ b/mi/flatten.c
@@ -441,14 +441,16 @@ compare(Flattenctx *s, Node *n, int fields)
static Node *
assign(Flattenctx *s, Node *lhs, Node *rhs)
{
- Node *r, *t, *u;
+ Node *r, *t, *e, *u;
if (exprop(lhs) == Otup) {
r = destructure(s, lhs, rhs);
} else if (tybase(exprtype(lhs))->type != Tyvoid) {
t = lval(s, lhs);
u = rval(s, rhs);
- r = asn(t, u);
+ e = asn(t, u);
+ append(s, e);
+ r = t;
} else {
r = rval(s, rhs);
}