From 24ae9e44d6aa93d7f36746d02cb0401e8a925fde Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Sat, 20 Jan 2024 17:14:40 -0800 Subject: fix segfault --- src/stem.c | 2 +- stemlib/unsafe.stem | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 stemlib/unsafe.stem diff --git a/src/stem.c b/src/stem.c index 66aaff9..6fc6144 100644 --- a/src/stem.c +++ b/src/stem.c @@ -91,7 +91,7 @@ value_t *value_copy(value_t *v) { a->type = v->type; if (v->type == VINT || v->type == VFLOAT) { a->int_float = v->int_float; - } else if (v->type == VSTR || v->type == VWORD) { + } else if (v->type == VSTR || v->type == VWORD || v->type == VERR) { a->str_word = string_copy(v->str_word); a->escaped = v->escaped; } else if (v->type == VQUOTE) { diff --git a/stemlib/unsafe.stem b/stemlib/unsafe.stem new file mode 100644 index 0000000..8c9e43e --- /dev/null +++ b/stemlib/unsafe.stem @@ -0,0 +1,7 @@ +"./stdlib.stem" fread strquote eval + +unQstack [ map [ len vat ] ] func + +[ 1 2 3 4 ] unQstack +? + -- cgit