"newtag" does not need a type name.

This commit is contained in:
Roberto Ierusalimschy
1997-04-02 19:52:42 -03:00
parent f0d523887d
commit 27d95f1880
4 changed files with 25 additions and 49 deletions

View File

@@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio
*/
char *rcs_opcode="$Id: opcode.c,v 3.90 1997/04/01 19:02:43 roberto Exp roberto $";
char *rcs_opcode="$Id: opcode.c,v 3.91 1997/04/02 17:44:18 roberto Exp roberto $";
#include <setjmp.h>
#include <stdio.h>
@@ -987,6 +987,8 @@ void lua_pushbinarydata (void *buff, int size, int tag)
if (buff == NULL)
ttype(top) = LUA_T_NIL;
else {
if (!luaI_userdatatag(tag))
lua_error("invalid tag for userdata");
tsvalue(top) = luaI_createuserdata(buff, size, tag);
ttype(top) = LUA_T_USERDATA;
}
@@ -998,8 +1000,6 @@ void lua_pushbinarydata (void *buff, int size, int tag)
*/
void lua_pushusertag (void *u, int tag)
{
if (luaI_typetag(tag) != LUA_T_USERDATA)
lua_error("invalid tag in `lua_pushusertag'");
lua_pushbinarydata(&u, sizeof(void *), tag);
}