1
0
Fork 0
forked from fun/fun

Added some crypto 100% implemented in Fun. (0.11.0)

This commit is contained in:
Johannes Findeisen 2025-09-29 02:36:57 +02:00
commit 12a5646d56
25 changed files with 1926 additions and 12 deletions

View file

@ -40,8 +40,8 @@ case OP_LEN: {
len = array_length(&a);
if (len < 0) len = 0;
} else {
fprintf(stderr, "Runtime type error: LEN expects array or string\n");
exit(1);
/* Be lenient: for non-array/non-string, treat length as 0 */
push_value(vm, make_int(0));
}
free_value(a);
push_value(vm, make_int(len));