aboutsummaryrefslogtreecommitdiff
path: root/opcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-04-02 19:52:42 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-04-02 19:52:42 -0300
commit27d95f18803aded238eaa8adaf7f2a3ee6966fd3 (patch)
tree7b20dbfac6b14aa2ca112bee48aac22c47db78dc /opcode.c
parentf0d523887d28c569e931eacbe1078599750cd5b7 (diff)
downloadlua-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/opcode.c b/opcode.c
index be2be6a3..5bbfe609 100644
--- a/opcode.c
+++ b/opcode.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_opcode="$Id: opcode.c,v 3.90 1997/04/01 19:02:43 roberto Exp roberto $"; 6char *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*/
999void lua_pushusertag (void *u, int tag) 1001void 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