MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / removelastlineinfo

Function removelastlineinfo

3rd/lua-5.4.3/src/lcode.c:352–364  ·  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

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

Callers 2

removelastinstructionFunction · 0.85
luaK_fixlineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected