** 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'. */
| 335 | ** Otherwise, store the difference from last line in 'lineinfo'. |
| 336 | */ |
| 337 | static void savelineinfo (FuncState *fs, Proto *f, int line) { |
| 338 | int linedif = line - fs->previousline; |
| 339 | int pc = fs->pc - 1; /* last instruction coded */ |
| 340 | if (abs(linedif) >= LIMLINEDIFF || fs->iwthabs++ > MAXIWTHABS) { |
| 341 | luaM_growvector(fs->ls->L, f->abslineinfo, fs->nabslineinfo, |
| 342 | f->sizeabslineinfo, AbsLineInfo, MAX_INT, "lines"); |
| 343 | f->abslineinfo[fs->nabslineinfo].pc = pc; |
| 344 | f->abslineinfo[fs->nabslineinfo++].line = line; |
| 345 | linedif = ABSLINEINFO; /* signal that there is absolute information */ |
| 346 | fs->iwthabs = 0; /* restart counter */ |
| 347 | } |
| 348 | luaM_growvector(fs->ls->L, f->lineinfo, pc, f->sizelineinfo, ls_byte, |
| 349 | MAX_INT, "opcodes"); |
| 350 | f->lineinfo[pc] = linedif; |
| 351 | fs->previousline = line; /* last line saved */ |
| 352 | } |
| 353 | |
| 354 | |
| 355 | /* |
no outgoing calls
no test coverage detected