ref: 932320f93ec0266a53c3e50600d73d3d23e1db76
parent: 3c1277e37fbaea87d770d4a64a5029c4a693bb63
author: Andrew Chambers <andrewchamberss@gmail.com>
date: Sat Feb 6 06:20:55 EST 2016
fix rval len, fixes #69
--- a/6/simp.c
+++ b/6/simp.c
@@ -295,7 +295,7 @@
static Node *slicelen(Simp *s, Node *sl)
{
/* *(&sl + sizeof(size_t)) */
- return load(addk(addr(s, sl, tyintptr), Ptrsz));
+ return load(addk(addr(s, rval(s, sl, NULL), tyintptr), Ptrsz));
}
Node *loadvar(Simp *s, Node *n, Node *dst)
--- /dev/null
+++ b/test/rvaldotlen.myr
@@ -1,0 +1,21 @@
+use std
+
+const f1 = { -> byte[:]
+ -> [1, 2, 3][:]
+}
+
+const f2 = { -> byte[3]
+ -> [1, 2, 3]
+}
+
+
+const main = {
+ if f1().len != 3
+ -> void
+ ;;
+ if f2().len != 3
+ -> void
+ ;;
+ std.put("pass\n")
+}
+
--- a/test/tests
+++ b/test/tests
@@ -154,3 +154,4 @@
B voideffect P pass
B foroptexpr P pass
B bounds E 134
+B rvaldotlen P pass