From 27d95f18803aded238eaa8adaf7f2a3ee6966fd3 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy <roberto@inf.puc-rio.br> Date: Wed, 2 Apr 1997 19:52:42 -0300 Subject: "newtag" does not need a type name. --- opcode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'opcode.c') diff --git a/opcode.c b/opcode.c index be2be6a3..5bbfe609 100644 --- a/opcode.c +++ b/opcode.c @@ -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); } -- cgit v1.2.3-55-g6feb