From 2cd47459acca8c1e26760264b82586b8645f4e2d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 19 Mar 2018 21:46:52 -0700 Subject: vm: variadic arg closures bug 1/3. * lib.c (func_vm): fix incorrect assignment of int boolean to one-bit-wide bitfield. The argument isn't zero or one; in fact the value 256 gets passed down representing true. This gets truncated to one bit which is zero. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.c b/lib.c index e80ed6d4..7c201e90 100644 --- a/lib.c +++ b/lib.c @@ -6012,7 +6012,7 @@ val func_vm(val closure, val desc, int fixparam, int reqargs, int variadic) obj->f.f.vm_desc = desc; obj->f.fixparam = fixparam; obj->f.optargs = fixparam - reqargs; - obj->f.variadic = variadic; + obj->f.variadic = (variadic != 0); return obj; } -- cgit v1.2.3