diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-09-16 14:57:51 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-09-16 14:57:51 -0300 |
commit | e51564d1bee5aa8b411328d7d3d75906dfc0a260 (patch) | |
tree | 0f2d6e9185961be7999757085226ca87a2c7486d | |
parent | 98ec7995912af0aaaf9a97c5bc1be17e9b601af9 (diff) | |
download | lua-e51564d1bee5aa8b411328d7d3d75906dfc0a260.tar.gz lua-e51564d1bee5aa8b411328d7d3d75906dfc0a260.tar.bz2 lua-e51564d1bee5aa8b411328d7d3d75906dfc0a260.zip |
Details in comments and documentation
-rw-r--r-- | lstate.h | 11 | ||||
-rw-r--r-- | manual/manual.of | 10 |
2 files changed, 21 insertions, 0 deletions
@@ -334,6 +334,12 @@ struct lua_State { | |||
334 | 334 | ||
335 | /* | 335 | /* |
336 | ** Union of all collectable objects (only for conversions) | 336 | ** Union of all collectable objects (only for conversions) |
337 | ** ISO C99, 6.5.2.3 p.5: | ||
338 | ** "if a union contains several structures that share a common initial | ||
339 | ** sequence [...], and if the union object currently contains one | ||
340 | ** of these structures, it is permitted to inspect the common initial | ||
341 | ** part of any of them anywhere that a declaration of the complete type | ||
342 | ** of the union is visible." | ||
337 | */ | 343 | */ |
338 | union GCUnion { | 344 | union GCUnion { |
339 | GCObject gc; /* common header */ | 345 | GCObject gc; /* common header */ |
@@ -347,6 +353,11 @@ union GCUnion { | |||
347 | }; | 353 | }; |
348 | 354 | ||
349 | 355 | ||
356 | /* | ||
357 | ** ISO C99, 6.7.2.1 p.14: | ||
358 | ** "A pointer to a union object, suitably converted, points to each of | ||
359 | ** its members [...], and vice versa." | ||
360 | */ | ||
350 | #define cast_u(o) cast(union GCUnion *, (o)) | 361 | #define cast_u(o) cast(union GCUnion *, (o)) |
351 | 362 | ||
352 | /* macros to convert a GCObject into a specific value */ | 363 | /* macros to convert a GCObject into a specific value */ |
diff --git a/manual/manual.of b/manual/manual.of index c37f3061..ff891399 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
@@ -6813,6 +6813,16 @@ As such, it is only available on some platforms | |||
6813 | (Windows, Linux, Mac OS X, Solaris, BSD, | 6813 | (Windows, Linux, Mac OS X, Solaris, BSD, |
6814 | plus other Unix systems that support the @id{dlfcn} standard). | 6814 | plus other Unix systems that support the @id{dlfcn} standard). |
6815 | 6815 | ||
6816 | This function is inherently insecure, | ||
6817 | as it allows Lua to call any function in any readable dynamic | ||
6818 | library in the system. | ||
6819 | (Lua calls any function assuming the function | ||
6820 | has a proper prototype and respects a proper protocol | ||
6821 | @see{lua_CFunction}. | ||
6822 | Therefore, | ||
6823 | calling an arbitrary function in an arbitrary dynamic library | ||
6824 | more often than not results in an access violation.) | ||
6825 | |||
6816 | } | 6826 | } |
6817 | 6827 | ||
6818 | @LibEntry{package.path| | 6828 | @LibEntry{package.path| |