/* This may seem expensive but this is only accessed frequently in traceexec and the while loop will be executed roughly half the number of non-blank source lines in the Lua function and these tend to be short.  */
int luaG_getline(const Proto *f, int pc)
/* This may seem expensive but this is only accessed frequently in traceexec and the while loop will be executed roughly half the number of non-blank source lines in the Lua function and these tend to be short.  */
int luaG_getline(const Proto *f, int pc)
{
    if (*p & INFO_DELTA_MASK) {
      int delta = *p & INFO_DELTA_6BITS;
      unsigned char sign = *p++ & INFO_SIGN_MASK;
      int shift;
      for (shift = 6; *p & INFO_DELTA_MASK; p++, shift += 7) {
        delta += (*p & INFO_DELTA_7BITS)<<shift;
      }
      line += sign ? -delta : delta+2;
    } else {
      line++;
    }
    lua_assert(*p<127);
    nextpc = thispc + *p++;
    if (thispc <= pc && pc < nextpc) {
      return line;
    }
    thispc = nextpc;
  }
  lua_assert(0);
  return 0;
}