summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-27 19:38:49 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-27 19:38:49 -0300
commitef3c45d5230b08d87b53d67c04f34873c3d24933 (patch)
treea8b76b4bd5ea8aade1c0eec1bf017ce91d863b0b
parent20a48a818f4084f1b6480e3ec846c219abaafd5b (diff)
downloadlua-3.0.tar.gz
lua-3.0.tar.bz2
lua-3.0.zip
for security reasons, one cannot change the tag of a udatav3.0
from Lua.
-rw-r--r--inout.c4
-rw-r--r--manual.tex14
2 files changed, 9 insertions, 9 deletions
diff --git a/inout.c b/inout.c
index 574253cc..0b36c70e 100644
--- a/inout.c
+++ b/inout.c
@@ -5,7 +5,7 @@
5** Also provides some predefined lua functions. 5** Also provides some predefined lua functions.
6*/ 6*/
7 7
8char *rcs_inout="$Id: inout.c,v 2.67 1997/06/23 18:27:53 roberto Exp roberto $"; 8char *rcs_inout="$Id: inout.c,v 2.68 1997/06/26 20:47:43 roberto Exp roberto $";
9 9
10#include <stdio.h> 10#include <stdio.h>
11#include <string.h> 11#include <string.h>
@@ -313,7 +313,7 @@ static void luaI_call (void)
313static void luaIl_settag (void) 313static void luaIl_settag (void)
314{ 314{
315 lua_Object o = lua_getparam(1); 315 lua_Object o = lua_getparam(1);
316 luaL_arg_check(o != LUA_NOOBJECT, 1, NULL); 316 luaL_arg_check(lua_istable(o), 1, "table expected");
317 lua_pushobject(o); 317 lua_pushobject(o);
318 lua_settag(luaL_check_number(2)); 318 lua_settag(luaL_check_number(2));
319} 319}
diff --git a/manual.tex b/manual.tex
index 62fb7fe5..747a3e82 100644
--- a/manual.tex
+++ b/manual.tex
@@ -1,4 +1,4 @@
1% $Id: manual.tex,v 2.6 1997/06/26 20:39:10 roberto Exp roberto $ 1% $Id: manual.tex,v 2.7 1997/06/27 18:39:34 roberto Exp roberto $
2 2
3\documentstyle[fullpage,11pt,bnf]{article} 3\documentstyle[fullpage,11pt,bnf]{article}
4 4
@@ -38,7 +38,7 @@ Waldemar Celes
38\tecgraf\ --- Computer Science Department --- PUC-Rio 38\tecgraf\ --- Computer Science Department --- PUC-Rio
39} 39}
40 40
41\date{\small \verb$Date: 1997/06/26 20:39:10 $} 41\date{\small \verb$Date: 1997/06/27 18:39:34 $}
42 42
43\maketitle 43\maketitle
44 44
@@ -263,7 +263,7 @@ values of type userdata and table can have
263as many different tags as needed \see{tag-method}. 263as many different tags as needed \see{tag-method}.
264Tags are created with the function \verb|newtag|, 264Tags are created with the function \verb|newtag|,
265and the function \verb|tag| returns the tag of a given value. 265and the function \verb|tag| returns the tag of a given value.
266To change the tag of a given userdata or table, 266To change the tag of a given table,
267there is the function \verb|settag| \see{pdf-newtag}. 267there is the function \verb|settag| \see{pdf-newtag}.
268 268
269 269
@@ -1723,12 +1723,12 @@ This function allows Lua to test the tag of a value \see{TypesSec}.
1723It receives one argument, and returns its tag (a number). 1723It receives one argument, and returns its tag (a number).
1724\verb|tag| is equivalent to the API function \verb|lua_tag|. 1724\verb|tag| is equivalent to the API function \verb|lua_tag|.
1725 1725
1726\subsubsection*{\ff {\tt settag (o, tag)}}\Deffunc{settag} 1726\subsubsection*{\ff {\tt settag (t, tag)}}\Deffunc{settag}
1727This function sets the tag of a given object \see{TypesSec}. 1727This function sets the tag of a given table \see{TypesSec}.
1728The object \verb|o| must be a userdata or a table.
1729\verb|tag| must be a value created with \verb|newtag| 1728\verb|tag| must be a value created with \verb|newtag|
1730\see{pdf-newtag}. 1729\see{pdf-newtag}.
1731\verb|settag| is equivalent to the API function \verb|lua_settag|. 1730For security reasons,
1731it is impossible to change the tag of a userdata from Lua.
1732 1732
1733\subsubsection*{\ff {\tt assert (v)}}\Deffunc{assert} 1733\subsubsection*{\ff {\tt assert (v)}}\Deffunc{assert}
1734This function issues an {\em ``assertion failed!''} error 1734This function issues an {\em ``assertion failed!''} error