aboutsummaryrefslogtreecommitdiffstats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/compile.c b/compiler/compile.c
index 0fcaa1b..5c88b97 100644
--- a/compiler/compile.c
+++ b/compiler/compile.c
@@ -3738,6 +3738,11 @@ static Kind value(Compiler *c, const Expr *e, bool handler, int height) {
return field_value(r, field);
}
case E_INDEX: {
+ int given = e->count == 2 ? rows_list(c, e->args[0]) : -1;
+ if (given >= 0) { /* a message's rows' item at a position: read where they are, not from a copy of them */
+ item_of(c, e->args[1], handler, height, given);
+ return item_value(c, e, given);
+ }
Kind base = value(c, e->args[0], handler, height);
if (base.type == LIST && e->count == 2) { /* a list value's item at a position */
int reg = bind_list(c, e, base);