ref: 68c5b1225572ecf2c52baf62f928063e5a30511b
parent: 2923137ef047b401d560766537782f60e67f9a0c
author: Jeff Bezanson <[email protected]>
date: Tue Aug 9 18:58:44 EDT 2016
fix #22 segfault printing stack trace for error during evaluation of argument default values
--- a/flisp.c
+++ b/flisp.c
@@ -1991,7 +1991,13 @@
&vector_elt(Stack[bp+1],0), (sz-1)*sizeof(value_t));
}
else {
- memcpy(&vector_elt(v,0), &Stack[bp], sz*sizeof(value_t));
+ uint32_t i;
+ for(i=0; i < sz; i++) {
+ value_t si = Stack[bp+i];
+ // if there's an error evaluating argument defaults some slots
+ // might be left set to UNBOUND (issue #22)
+ vector_elt(v,i) = (si == UNBOUND ? FL_UNSPECIFIED : si);
+ }
}
lst = fl_cons(v, lst);
top = Stack[top-4];