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

Function luaK_checkstack

libraries/AP_Scripting/lua/src/lcode.c:368–376  ·  view source on GitHub ↗

** Check register-stack level, keeping track of its maximum size ** in field 'maxstacksize' */

Source from the content-addressed store, hash-verified

366** in field 'maxstacksize'
367*/
368void luaK_checkstack (FuncState *fs, int n) {
369 int newstack = fs->freereg + n;
370 if (newstack > fs->f->maxstacksize) {
371 if (newstack >= MAXREGS)
372 luaX_syntaxerror(fs->ls,
373 "function or expression needs too many registers");
374 fs->f->maxstacksize = cast_byte(newstack);
375 }
376}
377
378
379/*

Callers 2

forlistFunction · 0.85
luaK_reserveregsFunction · 0.85

Calls 1

luaX_syntaxerrorFunction · 0.85

Tested by

no test coverage detected