diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-27 19:38:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-27 19:38:49 -0300 |
commit | ef3c45d5230b08d87b53d67c04f34873c3d24933 (patch) | |
tree | a8b76b4bd5ea8aade1c0eec1bf017ce91d863b0b | |
parent | 20a48a818f4084f1b6480e3ec846c219abaafd5b (diff) | |
download | lua-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.c | 4 | ||||
-rw-r--r-- | manual.tex | 14 |
2 files changed, 9 insertions, 9 deletions
@@ -5,7 +5,7 @@ | |||
5 | ** Also provides some predefined lua functions. | 5 | ** Also provides some predefined lua functions. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | char *rcs_inout="$Id: inout.c,v 2.67 1997/06/23 18:27:53 roberto Exp roberto $"; | 8 | char *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) | |||
313 | static void luaIl_settag (void) | 313 | static 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 | } |
@@ -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 | |||
263 | as many different tags as needed \see{tag-method}. | 263 | as many different tags as needed \see{tag-method}. |
264 | Tags are created with the function \verb|newtag|, | 264 | Tags are created with the function \verb|newtag|, |
265 | and the function \verb|tag| returns the tag of a given value. | 265 | and the function \verb|tag| returns the tag of a given value. |
266 | To change the tag of a given userdata or table, | 266 | To change the tag of a given table, |
267 | there is the function \verb|settag| \see{pdf-newtag}. | 267 | there 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}. | |||
1723 | It receives one argument, and returns its tag (a number). | 1723 | It 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} |
1727 | This function sets the tag of a given object \see{TypesSec}. | 1727 | This function sets the tag of a given table \see{TypesSec}. |
1728 | The 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|. | 1730 | For security reasons, |
1731 | it 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} |
1734 | This function issues an {\em ``assertion failed!''} error | 1734 | This function issues an {\em ``assertion failed!''} error |