summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-10-04 09:47:43 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-10-04 09:47:43 -0700
commit0b587e521b5bee74c530adcf4636993ed91036c4 (patch)
tree6d232443e34c976ef2240538ac792bc876752acc /struct.c
parent3911b067ed00ad1cda5cdebd9945f1e5d80b6a57 (diff)
downloadtxr-0b587e521b5bee74c530adcf4636993ed91036c4.tar.gz
txr-0b587e521b5bee74c530adcf4636993ed91036c4.tar.bz2
txr-0b587e521b5bee74c530adcf4636993ed91036c4.zip
Bugfix: boa must apply last, as documented.
* struct.c (make_struct): Process property list first, then call boa constructor, not vice versa.
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/struct.c b/struct.c
index bc490a6e..4ff01a74 100644
--- a/struct.c
+++ b/struct.c
@@ -356,6 +356,9 @@ val make_struct(val type, val plist, struct args *args)
call_initfun_chain(st, sinst);
+ for (; plist; plist = cddr(plist))
+ slotset(sinst, car(plist), cadr(plist));
+
if (args_more(args, 0)) {
args_decl(args_copy, max(args->fill + 1, ARGS_MIN));
args_add(args_copy, sinst);
@@ -363,9 +366,6 @@ val make_struct(val type, val plist, struct args *args)
generic_funcall(st->boactor, args_copy);
}
- for (; plist; plist = cddr(plist))
- slotset(sinst, car(plist), cadr(plist));
-
return sinst;
}
}