From 709587d9f92d8c49be0a2c532776900bc41e1ff1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 16 Nov 2015 20:16:27 -0800 Subject: Combat spurious retention in args handling code. * args.c (args_normalize): Zap the argument in the array when moving it over to the list. * args.h (args_atz): When zapping the argument in the list, zap the actual car field, rather than the list itself. It seems there is a copy of the list somewhere, so zapping it is not effective. --- args.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'args.h') diff --git a/args.h b/args.h index a0ea1743..23869d30 100644 --- a/args.h +++ b/args.h @@ -143,9 +143,12 @@ INLINE val args_at(struct args *args, cnum arg_index) INLINE val args_atz(struct args *args, cnum arg_index) { - if (arg_index < args->fill) + if (arg_index < args->fill) { return z(args->arg[arg_index]); - return car(z(args->list)); + } else { + loc l = car_l(args->list); + return zap(valptr(l)); + } } INLINE val args_get(struct args *args, cnum *arg_index) -- cgit v1.2.3