From f2fc66d71aabc92ba3d26c7829ebca80f69dbaa1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 15 Nov 2016 05:49:16 -0800 Subject: Fix bad mutation in arg handling. * args.h (args_atz): Do not zap the car field of the first list cons; rather, zap the list itself. The list shouldn't be modified because in apply calls, it is a data structure belonging to the caller. --- args.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'args.h') diff --git a/args.h b/args.h index 5735b828..964a8126 100644 --- a/args.h +++ b/args.h @@ -164,8 +164,7 @@ INLINE val args_atz(struct args *args, cnum arg_index) if (arg_index < args->fill) { return z(args->arg[arg_index]); } else { - loc l = car_l(args->list); - return zap(valptr(l)); + return car(z(args->list)); } } -- cgit v1.2.3