Added assert() to base library

also fixed regression in call()
This commit is contained in:
2020-12-27 13:36:17 -06:00
parent e7212b939d
commit 9012f9231b
5 changed files with 33 additions and 5 deletions

View File

@@ -173,7 +173,7 @@ bool call(CState *state, CObjClosure *closure, int args, int nresults, int offse
state->top -= extraArgs;
pushCallFrame(state, closure, func->args + 1);
} else if (args < func->args) { // too few args passed, obvious user error
} else if (args != func->args) { // mismatched args
cosmoV_error(state, "Expected %d arguments for %s, got %d!", closure->function->args, closure->function->name == NULL ? UNNAMEDCHUNK : closure->function->name->str, args);
return false;
} else {