#include <cassert>
#include <setjmp.h>
#include <stdlib.h>
#include <string.h>
#include "../lua_jailbreak_exception.hpp"
#include <exception>
#include "lua.h"
#include "lapi.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "lmem.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lparser.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"
#include "lundump.h"
#include "lvm.h"
#include "lzio.h"
Go to the source code of this file.
Classes | |
struct | lua_longjmp |
struct | SParser |
Macros | |
#define | ldo_c |
#define | LUA_CORE |
#define | LUAI_THROW(L, c) longjmp((c)->b, 1) |
#define | LUAI_TRY(L, c, a) if (setjmp((c)->b) == 0) { a } |
#define | luai_jmpbuf jmp_buf |
#define | ERRORSTACKSIZE (LUAI_MAXSTACK + 200) |
#define | next_ci(L) (L->ci = (L->ci->next ? L->ci->next : luaE_extendCI(L))) |
#define ERRORSTACKSIZE (LUAI_MAXSTACK + 200) |
Definition at line 180 of file ldo.cpp.
Referenced by luaD_growstack(), and luaD_reallocstack().
Definition at line 90 of file ldo.cpp.
Referenced by luaD_throw().
Definition at line 91 of file ldo.cpp.
Referenced by luaD_rawrunprotected().
#define next_ci | ( | L | ) | (L->ci = (L->ci->next ? L->ci->next : luaE_extendCI(L))) |
Definition at line 312 of file ldo.cpp.
Referenced by luaD_precall().
Definition at line 279 of file ldo.cpp.
References i, lua_assert, luaD_checkstack, Proto::maxstacksize, Proto::numparams, setnilvalue, setobjs2s, and lua_State::top.
Referenced by luaD_precall().
Definition at line 266 of file ldo.cpp.
References CallInfo::callstatus, CIST_TAIL, GET_OPCODE, isLua, CallInfo::l, LUA_HOOKCALL, LUA_HOOKTAILCALL, luaD_hook(), OP_TAILCALL, CallInfo::previous, and CallInfo::u.
Referenced by luaD_precall().
Definition at line 653 of file ldo.cpp.
References LUA_ERRSYNTAX, LUA_QS, luaD_throw(), and luaO_pushfstring().
Referenced by f_parser().
Definition at line 164 of file ldo.cpp.
References lua_State::ci, CallInfo::func, GCObject::gch, gco2uv, isLua, CallInfo::l, lua_State::openupval, CallInfo::previous, lua_State::stack, CallInfo::top, lua_State::top, and CallInfo::u.
Referenced by luaD_reallocstack().
Definition at line 662 of file ldo.cpp.
References SParser::buff, cast, checkmode(), SParser::dyd, i, Closure::l, lua_assert, LUA_SIGNATURE, luaC_objbarrier, luaF_newupval(), luaU_undump(), luaY_parser(), SParser::mode, SParser::name, LClosure::p, Proto::sizeupvalues, LClosure::upvals, SParser::z, and zgetc.
Referenced by luaD_protectedparser().
Definition at line 473 of file ldo.cpp.
References CallInfo::callstatus, lua_State::ci, CIST_YPCALL, and CallInfo::previous.
Referenced by recover().
Definition at line 430 of file ldo.cpp.
References adjustresults, api_checknelems, CallInfo::c, CallInfo::callstatus, lua_State::ci, CIST_STAT, CIST_YIELDED, CIST_YPCALL, lua_State::errfunc, lua_assert, lua_lock, LUA_OK, lua_unlock, LUA_YIELD, luaD_poscall(), lua_State::nny, CallInfo::nresults, lua_State::top, and CallInfo::u.
Referenced by unroll().
Definition at line 557 of file ldo.cpp.
References api_checknelems, cast_byte, lua_State::ci, lua_assert, LUA_ERRRUN, lua_lock, LUA_OK, lua_unlock, LUA_YIELD, luaD_rawrunprotected(), luai_userstateresume, lua_State::nCcalls, lua_State::nny, recover(), resume(), seterrorobj(), lua_longjmp::status, lua_State::status, CallInfo::top, lua_State::top, and unroll().
Referenced by auxresume(), and application_lua_kernel::thread::run_script().
Definition at line 589 of file ldo.cpp.
References api_check, api_checknelems, CallInfo::c, CallInfo::callstatus, lua_State::ci, CIST_HOOKED, CallInfo::extra, CallInfo::func, G, isLua, lua_assert, lua_lock, lua_unlock, LUA_YIELD, luaD_throw(), luaG_runerror(), luai_userstateyield, lua_State::nny, savestack, lua_State::status, lua_State::top, and CallInfo::u.
Definition at line 415 of file ldo.cpp.
References LUA_ERRERR, luaD_precall(), luaD_throw(), luaG_runerror(), LUAI_MAXCCALLS, luaV_execute(), lua_State::nCcalls, and lua_State::nny.
Referenced by callTM(), dothecall(), f_call(), lua_callk(), lua_pcallk(), luaG_errormsg(), and luaV_execute().
Definition at line 197 of file ldo.cpp.
References cast_int, ERRORSTACKSIZE, EXTRA_STACK, LUA_ERRERR, luaD_reallocstack(), luaD_throw(), luaG_runerror(), LUAI_MAXSTACK, lua_State::stack, lua_State::stacksize, and lua_State::top.
Referenced by growstack().
Definition at line 239 of file ldo.cpp.
References lua_State::allowhook, CallInfo::callstatus, lua_State::ci, CIST_HOOKED, lua_Debug::currentline, lua_Debug::event, lua_State::hook, lua_Debug::i_ci, lua_assert, lua_lock, LUA_MINSTACK, lua_unlock, luaD_checkstack, restorestack, savestack, lua_State::stack_last, CallInfo::top, and lua_State::top.
Referenced by callhook(), luaD_poscall(), luaD_precall(), and traceexec().
Definition at line 617 of file ldo.cpp.
References lua_State::allowhook, lua_State::ci, lua_State::errfunc, LUA_OK, luaD_rawrunprotected(), luaD_shrinkstack(), luaF_close(), lua_State::nny, restorestack, seterrorobj(), and lua_longjmp::status.
Referenced by GCTM(), lua_pcallk(), and luaD_protectedparser().
Definition at line 384 of file ldo.cpp.
References lua_State::ci, CallInfo::func, lua_State::hookmask, i, CallInfo::l, LUA_HOOKRET, LUA_MASKLINE, LUA_MASKRET, LUA_MULTRET, luaD_hook(), CallInfo::nresults, lua_State::oldpc, CallInfo::previous, restorestack, savestack, setnilvalue, setobjs2s, lua_State::top, and CallInfo::u.
Referenced by finishCcall(), luaD_precall(), luaV_execute(), and resume().
Definition at line 318 of file ldo.cpp.
References adjust_varargs(), api_checknelems, callhook(), CallInfo::callstatus, cast_int, CIST_LUA, clCvalue, clLvalue, Proto::code, CallInfo::func, fvalue, lua_State::hookmask, Proto::is_vararg, CallInfo::l, lua_assert, LUA_HOOKCALL, lua_lock, LUA_MASKCALL, LUA_MINSTACK, LUA_TCCL, LUA_TLCF, LUA_TLCL, lua_unlock, luaC_checkGC, luaD_checkstack, luaD_hook(), luaD_poscall(), luaD_precall(), Proto::maxstacksize, next_ci, CallInfo::nresults, Proto::numparams, restorestack, savestack, setnilvalue, lua_State::stack_last, CallInfo::top, lua_State::top, tryfuncTM(), ttype, and CallInfo::u.
Referenced by luaD_call(), luaD_precall(), luaV_execute(), and resume().
Definition at line 684 of file ldo.cpp.
References Dyndata::actvar, Labellist::arr, Dyndata::arr, SParser::buff, SParser::dyd, lua_State::errfunc, f_parser(), Dyndata::gt, Dyndata::label, luaD_pcall(), luaM_freearray, luaZ_freebuffer, luaZ_initbuffer, SParser::mode, SParser::name, lua_State::nny, savestack, Labellist::size, Dyndata::size, lua_State::top, and SParser::z.
Referenced by lua_load().
Definition at line 147 of file ldo.cpp.
References lua_State::errorJmp, LUA_OK, LUAI_TRY, lua_State::nCcalls, lua_longjmp::previous, and lua_longjmp::status.
Referenced by lua_checkstack(), lua_newstate(), lua_resume(), and luaD_pcall().
Definition at line 183 of file ldo.cpp.
References correctstack(), ERRORSTACKSIZE, EXTRA_STACK, lua_assert, LUAI_MAXSTACK, luaM_reallocvector, setnilvalue, lua_State::stack, lua_State::stack_last, and lua_State::stacksize.
Referenced by luaD_growstack(), and luaD_shrinkstack().
Definition at line 227 of file ldo.cpp.
References condmovestack, EXTRA_STACK, luaD_reallocstack(), LUAI_MAXSTACK, stackinuse(), and lua_State::stacksize.
Referenced by luaD_pcall(), recover(), and sweepthread().
Definition at line 125 of file ldo.cpp.
References cast_byte, lua_State::errorJmp, G, lua_unlock, luaD_throw(), LUAI_THROW, panic(), setobjs2s, lua_longjmp::status, lua_State::status, and lua_State::top.
Referenced by checkmode(), error(), GCTM(), lexerror(), lua_yieldk(), luaD_call(), luaD_growstack(), luaD_throw(), luaG_errormsg(), luaM_realloc_(), resume_error(), and traceexec().
Definition at line 483 of file ldo.cpp.
References lua_State::allowhook, CallInfo::c, CallInfo::callstatus, lua_State::ci, CIST_STAT, lua_State::errfunc, CallInfo::extra, findpcall(), luaD_shrinkstack(), luaF_close(), lua_State::nny, restorestack, seterrorobj(), lua_longjmp::status, and CallInfo::u.
Referenced by lua_resume().
Definition at line 518 of file ldo.cpp.
References api_checknelems, lua_State::base_ci, CallInfo::c, CallInfo::callstatus, cast, lua_State::ci, CIST_YIELDED, CallInfo::extra, CallInfo::func, isLua, lua_assert, lua_lock, LUA_MULTRET, LUA_OK, lua_unlock, LUA_YIELD, luaD_poscall(), luaD_precall(), LUAI_MAXCCALLS, luaV_execute(), lua_State::nCcalls, restorestack, resume_error(), lua_State::status, lua_State::top, CallInfo::u, and unroll().
Referenced by lua_resume().
Definition at line 507 of file ldo.cpp.
References api_incr_top, luaD_throw(), luaS_new(), setsvalue2s, and lua_State::top.
Referenced by resume().
Definition at line 106 of file ldo.cpp.
References G, LUA_ERRERR, LUA_ERRMEM, luaS_newliteral, setobjs2s, setsvalue2s, and lua_State::top.
Referenced by lua_resume(), luaD_pcall(), and recover().
Definition at line 216 of file ldo.cpp.
References cast_int, lua_State::ci, lua_assert, CallInfo::previous, lua_State::stack, lua_State::stack_last, CallInfo::top, and lua_State::top.
Referenced by luaD_shrinkstack().
Definition at line 296 of file ldo.cpp.
References incr_top, luaG_typeerror(), luaT_gettmbyobj(), restorestack, savestack, setobj2s, setobjs2s, TM_CALL, lua_State::top, and ttisfunction.
Referenced by luaD_precall().
Definition at line 455 of file ldo.cpp.
References lua_State::base_ci, lua_State::ci, finishCcall(), isLua, luaV_execute(), luaV_finishOp(), and UNUSED.
Referenced by lua_resume(), and resume().