Fix compiler warning.

This commit is contained in:
Mike Pall 2013-07-18 00:39:23 +02:00
parent dd44018d66
commit 1ddf5689b5

View File

@ -137,21 +137,22 @@ static BCLine debug_frameline(lua_State *L, GCfunc *fn, cTValue *nextframe)
/* Get name of a local variable from slot number and PC. */ /* Get name of a local variable from slot number and PC. */
static const char *debug_varname(const GCproto *pt, BCPos pc, BCReg slot) static const char *debug_varname(const GCproto *pt, BCPos pc, BCReg slot)
{ {
const uint8_t *p = proto_varinfo(pt); const char *p = (const char *)proto_varinfo(pt);
if (p) { if (p) {
BCPos lastpc = 0; BCPos lastpc = 0;
for (;;) { for (;;) {
const char *name = (const char *)p; const char *name = p;
uint32_t vn = *p++; uint32_t vn = *(const uint8_t *)p;
BCPos startpc, endpc; BCPos startpc, endpc;
if (vn < VARNAME__MAX) { if (vn < VARNAME__MAX) {
if (vn == VARNAME_END) break; /* End of varinfo. */ if (vn == VARNAME_END) break; /* End of varinfo. */
} else { } else {
while (*p++) ; /* Skip over variable name string. */ do { p++; } while (*(const uint8_t *)p); /* Skip over variable name. */
} }
lastpc = startpc = lastpc + lj_buf_ruleb128((const char **)&p); p++;
lastpc = startpc = lastpc + lj_buf_ruleb128(&p);
if (startpc > pc) break; if (startpc > pc) break;
endpc = startpc + lj_buf_ruleb128((const char **)&p); endpc = startpc + lj_buf_ruleb128(&p);
if (pc < endpc && slot-- == 0) { if (pc < endpc && slot-- == 0) {
if (vn < VARNAME__MAX) { if (vn < VARNAME__MAX) {
#define VARNAMESTR(name, str) str "\0" #define VARNAMESTR(name, str) str "\0"