diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-02 19:52:42 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-02 19:52:42 -0300 |
commit | 27d95f18803aded238eaa8adaf7f2a3ee6966fd3 (patch) | |
tree | 7b20dbfac6b14aa2ca112bee48aac22c47db78dc /opcode.c | |
parent | f0d523887d28c569e931eacbe1078599750cd5b7 (diff) | |
download | lua-27d95f18803aded238eaa8adaf7f2a3ee6966fd3.tar.gz lua-27d95f18803aded238eaa8adaf7f2a3ee6966fd3.tar.bz2 lua-27d95f18803aded238eaa8adaf7f2a3ee6966fd3.zip |
"newtag" does not need a type name.
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 | ||