MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / removelastlineinfo

Function removelastlineinfo

lib/lua/src/lcode.c:353–365  ·  view source on GitHub ↗

** Remove line information from the last instruction. ** If line information for that instruction is absolute, set 'iwthabs' ** above its max to force the new (replacing) instruction to have ** absolute line info, too. */

Source from the content-addressed store, hash-verified

351** absolute line info, too.
352*/
353static void removelastlineinfo (FuncState *fs) {
354 Proto *f = fs->f;
355 int pc = fs->pc - 1; /* last instruction coded */
356 if (f->lineinfo[pc] != ABSLINEINFO) { /* relative line info? */
357 fs->previousline -= f->lineinfo[pc]; /* correct last line saved */
358 fs->iwthabs--; /* undo previous increment */
359 }
360 else { /* absolute line information */
361 lua_assert(f->abslineinfo[fs->nabslineinfo - 1].pc == pc);
362 fs->nabslineinfo--; /* remove it */
363 fs->iwthabs = MAXIWTHABS + 1; /* force next line info to be absolute */
364 }
365}
366
367
368/*

Callers 2

removelastinstructionFunction · 0.85
luaK_fixlineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected