Skip to content

Commit

Permalink
change runtime error check in APPEND instruction to assert
Browse files Browse the repository at this point in the history
  • Loading branch information
Holodome committed Nov 26, 2023
1 parent e1c5808 commit 67d8116
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions hololisp/hll_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,11 @@ hll_value hll_interpret_bytecode_internal(hll_vm *vm, hll_value env_,
hll_gc_push_temp_root(vm->gc, obj);
hll_gc_push_temp_root(vm->gc, head);

assert(hll_is_nil(tail) == hll_is_nil(head));
hll_value cons = hll_new_cons(vm, obj, hll_nil());
if (hll_is_nil(head)) {
head = tail = cons;
} else {
if (!hll_is_cons(tail)) {
hll_runtime_error(vm,
"tail operand of APPEND is not a cons (found %s)",
hll_value_kind_str(tail));
}
hll_unwrap_cons(tail)->cdr = cons;
tail = cons;
}
Expand Down

0 comments on commit 67d8116

Please sign in to comment.