mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 07:23:05 +00:00
DIRECTOR: Lingo: Process extra or too few arguments for built-ins
This commit is contained in:
parent
783ff8f8f2
commit
dc498881ef
@ -702,7 +702,20 @@ void Lingo::c_call() {
|
||||
|
||||
Symbol *sym = g_lingo->_handlers[name];
|
||||
|
||||
if (sym->nargs < nargs) {
|
||||
warning("Incorrect number of arguments for function %s. Dropping extra %d", name.c_str(), nargs - sym->nargs);
|
||||
for (int i = 0; i < nargs - sym->nargs; i++)
|
||||
g_lingo->pop();
|
||||
}
|
||||
|
||||
if (sym->type == BLTIN) {
|
||||
if (sym->nargs > 0 && nargs < sym->nargs) {
|
||||
warning("Too few arguments for function %s. Expecting %d but got %d", name.c_str(), sym->nargs, nargs);
|
||||
for (int i = 0; i < nargs; i++)
|
||||
g_lingo->pop();
|
||||
|
||||
return;
|
||||
}
|
||||
(*sym->u.func)();
|
||||
|
||||
return;
|
||||
|
@ -12,6 +12,8 @@ set x = 2 + 3 * (4 / 2)
|
||||
put x
|
||||
|
||||
put power(2, 8)
|
||||
put power(2, 8, 0)
|
||||
put power(2)
|
||||
updatestage
|
||||
|
||||
-- Type conversion
|
||||
|
Loading…
x
Reference in New Issue
Block a user