diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-10-17 12:30:05 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-10-17 12:30:05 -0200 |
| commit | a66404aca612b68def99db6c7daba549a8bba4b8 (patch) | |
| tree | 7567f225c54f3df3650752566eec63a426831142 /opcode.c | |
| parent | d80659759bcbcabf8b964356e5c9c867cd55effd (diff) | |
| download | lua-a66404aca612b68def99db6c7daba549a8bba4b8.tar.gz lua-a66404aca612b68def99db6c7daba549a8bba4b8.tar.bz2 lua-a66404aca612b68def99db6c7daba549a8bba4b8.zip | |
function "setfallback" now gives an error if called with wrong parameters.
Diffstat (limited to '')
| -rw-r--r-- | opcode.c | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_opcode="$Id: opcode.c,v 3.44 1995/10/17 11:58:41 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.45 1995/10/17 14:12:45 roberto Exp $"; |
| 7 | 7 | ||
| 8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
| 9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
| @@ -500,8 +500,10 @@ lua_Object lua_setfallback (char *name, lua_CFunction fallback) | |||
| 500 | stack[CBase].value.f = luaI_setfallback; | 500 | stack[CBase].value.f = luaI_setfallback; |
| 501 | lua_pushstring(name); | 501 | lua_pushstring(name); |
| 502 | lua_pushcfunction(fallback); | 502 | lua_pushcfunction(fallback); |
| 503 | do_protectedrun(1); | 503 | if (do_protectedrun(1) == 0) |
| 504 | return (Ref(top-1)); | 504 | return (Ref(top-1)); |
| 505 | else | ||
| 506 | return LUA_NOOBJECT; | ||
| 505 | } | 507 | } |
| 506 | 508 | ||
| 507 | 509 | ||
