summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 09bdfb2c..4edf4a85 100644
--- a/vm.c
+++ b/vm.c
@@ -119,7 +119,8 @@ val vm_make_desc(val nlevels, val nregs, val bytecode, val datavec)
{
mem_t *code = buf_get(bytecode, self);
- loc data_loc = vecref_l(datavec, zero);
+ val dvl = length_vec(datavec);
+ loc data_loc = if3(dvl != zero, vecref_l(datavec, zero), nulloc);
struct vm_desc *vd = coerce(struct vm_desc *, chk_malloc(sizeof *vd));
val desc;