summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-15 05:49:16 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-15 05:49:16 -0800
commitf2fc66d71aabc92ba3d26c7829ebca80f69dbaa1 (patch)
tree66c896a236d631c508c6431761216027f39caf9d
parent6946b9db4429d68038c01feb0a9e209be46599a6 (diff)
downloadtxr-f2fc66d71aabc92ba3d26c7829ebca80f69dbaa1.tar.gz
txr-f2fc66d71aabc92ba3d26c7829ebca80f69dbaa1.tar.bz2
txr-f2fc66d71aabc92ba3d26c7829ebca80f69dbaa1.zip
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.
-rw-r--r--args.h3
1 files changed, 1 insertions, 2 deletions
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));
}
}