mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
function "setfallback" now gives an error if called with wrong parameters.
This commit is contained in:
parent
d80659759b
commit
a66404aca6
2 changed files with 8 additions and 9 deletions
8
opcode.c
8
opcode.c
|
|
@ -3,7 +3,7 @@
|
|||
** TecCGraf - PUC-Rio
|
||||
*/
|
||||
|
||||
char *rcs_opcode="$Id: opcode.c,v 3.44 1995/10/17 11:58:41 roberto Exp roberto $";
|
||||
char *rcs_opcode="$Id: opcode.c,v 3.45 1995/10/17 14:12:45 roberto Exp $";
|
||||
|
||||
#include <setjmp.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -500,8 +500,10 @@ lua_Object lua_setfallback (char *name, lua_CFunction fallback)
|
|||
stack[CBase].value.f = luaI_setfallback;
|
||||
lua_pushstring(name);
|
||||
lua_pushcfunction(fallback);
|
||||
do_protectedrun(1);
|
||||
return (Ref(top-1));
|
||||
if (do_protectedrun(1) == 0)
|
||||
return (Ref(top-1));
|
||||
else
|
||||
return LUA_NOOBJECT;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue