** find a "name" for the RK value 'c' */
| 354 | ** find a "name" for the RK value 'c' |
| 355 | */ |
| 356 | static void kname (Proto *p, int pc, int c, const char **name) { |
| 357 | if (ISK(c)) { /* is 'c' a constant? */ |
| 358 | TValue *kvalue = &p->k[INDEXK(c)]; |
| 359 | if (ttisstring(kvalue)) { /* literal constant? */ |
| 360 | *name = svalue(kvalue); /* it is its own name */ |
| 361 | return; |
| 362 | } |
| 363 | /* else no reasonable name found */ |
| 364 | } |
| 365 | else { /* 'c' is a register */ |
| 366 | const char *what = getobjname(p, pc, c, name); /* search for 'c' */ |
| 367 | if (what && *what == 'c') { /* found a constant name? */ |
| 368 | return; /* 'name' already filled */ |
| 369 | } |
| 370 | /* else no reasonable name found */ |
| 371 | } |
| 372 | *name = "?"; /* no reasonable name found */ |
| 373 | } |
| 374 | |
| 375 | |
| 376 | static int filterpc (int pc, int jmptarget) { |
no test coverage detected