** Save line info for a new instruction. If difference from last line ** does not fit in a byte, of after that many instructions, save a new ** absolute line info; (in that case, the special value 'ABSLINEINFO' ** in 'lineinfo' signals the existence of this absolute information.) ** Otherwise, store the difference from last line in 'lineinfo'. */
| 326 | ** Otherwise, store the difference from last line in 'lineinfo'. |
| 327 | */ |
| 328 | static void savelineinfo (FuncState *fs, Proto *f, int line) { |
| 329 | int linedif = line - fs->previousline; |
| 330 | int pc = fs->pc - 1; /* last instruction coded */ |
| 331 | if (abs(linedif) >= LIMLINEDIFF || fs->iwthabs++ >= MAXIWTHABS) { |
| 332 | luaM_growvector(fs->ls->L, f->abslineinfo, fs->nabslineinfo, |
| 333 | f->sizeabslineinfo, AbsLineInfo, MAX_INT, "lines"); |
| 334 | f->abslineinfo[fs->nabslineinfo].pc = pc; |
| 335 | f->abslineinfo[fs->nabslineinfo++].line = line; |
| 336 | linedif = ABSLINEINFO; /* signal that there is absolute information */ |
| 337 | fs->iwthabs = 1; /* restart counter */ |
| 338 | } |
| 339 | luaM_growvector(fs->ls->L, f->lineinfo, pc, f->sizelineinfo, ls_byte, |
| 340 | MAX_INT, "opcodes"); |
| 341 | f->lineinfo[pc] = linedif; |
| 342 | fs->previousline = line; /* last line saved */ |
| 343 | } |
| 344 | |
| 345 | |
| 346 | /* |
no outgoing calls
no test coverage detected