mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Add jit.security().
This commit is contained in:
parent
ff34b48ddd
commit
2e68e1fc18
@ -113,6 +113,13 @@ LJLIB_CF(jit_status)
|
||||
#endif
|
||||
}
|
||||
|
||||
LJLIB_CF(jit_security)
|
||||
{
|
||||
int idx = lj_lib_checkopt(L, 1, -1, LJ_SECURITY_MODESTRING);
|
||||
setintV(L->top++, ((LJ_SECURITY_MODE >> (2*idx)) & 3));
|
||||
return 1;
|
||||
}
|
||||
|
||||
LJLIB_CF(jit_attach)
|
||||
{
|
||||
#ifdef LUAJIT_DISABLE_VMEVENT
|
||||
|
@ -665,4 +665,14 @@ extern void *LJ_WIN_LOADLIBA(const char *path);
|
||||
#define LUAJIT_SECURITY_MCODE 1
|
||||
#endif
|
||||
|
||||
#define LJ_SECURITY_MODE \
|
||||
( 0u \
|
||||
| ((LUAJIT_SECURITY_PRNG & 3) << 0) \
|
||||
| ((LUAJIT_SECURITY_STRHASH & 3) << 2) \
|
||||
| ((LUAJIT_SECURITY_STRID & 3) << 4) \
|
||||
| ((LUAJIT_SECURITY_MCODE & 3) << 6) \
|
||||
)
|
||||
#define LJ_SECURITY_MODESTRING \
|
||||
"\004prng\007strhash\005strid\005mcode"
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user