diff options
Diffstat (limited to 'opcode.c')
| -rw-r--r-- | opcode.c | 6 |
1 files changed, 3 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.90 1997/04/01 19:02:43 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.91 1997/04/02 17:44:18 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
| 9 | #include <stdio.h> | 9 | #include <stdio.h> |
| @@ -987,6 +987,8 @@ void lua_pushbinarydata (void *buff, int size, int tag) | |||
| 987 | if (buff == NULL) | 987 | if (buff == NULL) |
| 988 | ttype(top) = LUA_T_NIL; | 988 | ttype(top) = LUA_T_NIL; |
| 989 | else { | 989 | else { |
| 990 | if (!luaI_userdatatag(tag)) | ||
| 991 | lua_error("invalid tag for userdata"); | ||
| 990 | tsvalue(top) = luaI_createuserdata(buff, size, tag); | 992 | tsvalue(top) = luaI_createuserdata(buff, size, tag); |
| 991 | ttype(top) = LUA_T_USERDATA; | 993 | ttype(top) = LUA_T_USERDATA; |
| 992 | } | 994 | } |
| @@ -998,8 +1000,6 @@ void lua_pushbinarydata (void *buff, int size, int tag) | |||
| 998 | */ | 1000 | */ |
| 999 | void lua_pushusertag (void *u, int tag) | 1001 | void lua_pushusertag (void *u, int tag) |
| 1000 | { | 1002 | { |
| 1001 | if (luaI_typetag(tag) != LUA_T_USERDATA) | ||
| 1002 | lua_error("invalid tag in `lua_pushusertag'"); | ||
| 1003 | lua_pushbinarydata(&u, sizeof(void *), tag); | 1003 | lua_pushbinarydata(&u, sizeof(void *), tag); |
| 1004 | } | 1004 | } |
| 1005 | 1005 | ||
