mirror of https://github.com/rusefi/lua.git
Details in comments and documentation
This commit is contained in:
parent
98ec799591
commit
e51564d1be
11
lstate.h
11
lstate.h
|
@ -334,6 +334,12 @@ struct lua_State {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Union of all collectable objects (only for conversions)
|
** Union of all collectable objects (only for conversions)
|
||||||
|
** ISO C99, 6.5.2.3 p.5:
|
||||||
|
** "if a union contains several structures that share a common initial
|
||||||
|
** sequence [...], and if the union object currently contains one
|
||||||
|
** of these structures, it is permitted to inspect the common initial
|
||||||
|
** part of any of them anywhere that a declaration of the complete type
|
||||||
|
** of the union is visible."
|
||||||
*/
|
*/
|
||||||
union GCUnion {
|
union GCUnion {
|
||||||
GCObject gc; /* common header */
|
GCObject gc; /* common header */
|
||||||
|
@ -347,6 +353,11 @@ union GCUnion {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** ISO C99, 6.7.2.1 p.14:
|
||||||
|
** "A pointer to a union object, suitably converted, points to each of
|
||||||
|
** its members [...], and vice versa."
|
||||||
|
*/
|
||||||
#define cast_u(o) cast(union GCUnion *, (o))
|
#define cast_u(o) cast(union GCUnion *, (o))
|
||||||
|
|
||||||
/* macros to convert a GCObject into a specific value */
|
/* macros to convert a GCObject into a specific value */
|
||||||
|
|
|
@ -6813,6 +6813,16 @@ As such, it is only available on some platforms
|
||||||
(Windows, Linux, Mac OS X, Solaris, BSD,
|
(Windows, Linux, Mac OS X, Solaris, BSD,
|
||||||
plus other Unix systems that support the @id{dlfcn} standard).
|
plus other Unix systems that support the @id{dlfcn} standard).
|
||||||
|
|
||||||
|
This function is inherently insecure,
|
||||||
|
as it allows Lua to call any function in any readable dynamic
|
||||||
|
library in the system.
|
||||||
|
(Lua calls any function assuming the function
|
||||||
|
has a proper prototype and respects a proper protocol
|
||||||
|
@see{lua_CFunction}.
|
||||||
|
Therefore,
|
||||||
|
calling an arbitrary function in an arbitrary dynamic library
|
||||||
|
more often than not results in an access violation.)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@LibEntry{package.path|
|
@LibEntry{package.path|
|
||||||
|
|
Loading…
Reference in New Issue