shithub: mc

Download patch

ref: 12da19e4d0545514a36f30bd7db39f428cfa67c5
parent: aed73f868fbd7b9774c25031893adda907a9558c
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jun 10 08:59:16 EDT 2018

Correctly float assignments inside function arguments.

--- a/lib/std/bigint.myr
+++ b/lib/std/bigint.myr
@@ -193,10 +193,6 @@
 	;;
 
 	n = 0
-	if bigiszero(x)
-		n += encode(buf[n:], '0')
-	;;
-
 	if base == 0
 		b = mkbigint(10)
 	else
--- a/lib/std/bytealloc.myr
+++ b/lib/std/bytealloc.myr
@@ -292,6 +292,7 @@
 		die("Unable to get memory")
 	;;
 
+	b = Zchunk
 	s = (align((p : size), Slabsz) : slab#)
 	s.head = p
 	s.nfree = bkt.nper
--- a/mi/flatten.c
+++ b/mi/flatten.c
@@ -441,7 +441,7 @@
 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);
@@ -448,7 +448,9 @@
 	} 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);
 	}