MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaD_protectedparser

Function luaD_protectedparser

libraries/AP_Scripting/lua/src/ldo.c:796–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

794
795
796int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,
797 const char *mode) {
798 struct SParser p;
799 int status;
800 L->nny++; /* cannot yield during parsing */
801 p.z = z; p.name = name; p.mode = mode;
802 p.dyd.actvar.arr = NULL; p.dyd.actvar.size = 0;
803 p.dyd.gt.arr = NULL; p.dyd.gt.size = 0;
804 p.dyd.label.arr = NULL; p.dyd.label.size = 0;
805 luaZ_initbuffer(L, &p.buff);
806 status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc);
807 luaZ_freebuffer(L, &p.buff);
808 luaM_freearray(L, p.dyd.actvar.arr, p.dyd.actvar.size);
809 luaM_freearray(L, p.dyd.gt.arr, p.dyd.gt.size);
810 luaM_freearray(L, p.dyd.label.arr, p.dyd.label.size);
811 L->nny--;
812 return status;
813}
814
815

Callers 1

lua_loadFunction · 0.85

Calls 1

luaD_pcallFunction · 0.85

Tested by

no test coverage detected