ref: ef35a8760cdd0e4dfb28c4119fc14f271f0e7090
parent: 0d07fd7ffdcfeeb89426d3e8a06c95b895b316fe
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Apr 14 15:45:49 EDT 2025
vm: apply: throw a type error (rather than assert) if not a function
--- a/src/vm.h
+++ b/src/vm.h
@@ -52,7 +52,8 @@
NEXT_OP;
}
int i = uintval(v);
- assert(isbuiltin(v));
+ if(!isbuiltin(v))
+ type_error("fn", v);
sl_fx s = builtins[i].nargs;
if(s >= 0){
sl.sp = sp;