** find a "name" for the RK value 'c' */
| 325 | ** find a "name" for the RK value 'c' |
| 326 | */ |
| 327 | static void kname (Proto *p, int pc, int c, const char **name) { |
| 328 | if (ISK(c)) { /* is 'c' a constant? */ |
| 329 | TValue *kvalue = &p->k[INDEXK(c)]; |
| 330 | if (ttisstring(kvalue)) { /* literal constant? */ |
| 331 | *name = svalue(kvalue); /* it is its own name */ |
| 332 | return; |
| 333 | } |
| 334 | /* else no reasonable name found */ |
| 335 | } |
| 336 | else { /* 'c' is a register */ |
| 337 | const char *what = getobjname(p, pc, c, name); /* search for 'c' */ |
| 338 | if (what && *what == 'c') { /* found a constant name? */ |
| 339 | return; /* 'name' already filled */ |
| 340 | } |
| 341 | /* else no reasonable name found */ |
| 342 | } |
| 343 | *name = "?"; /* no reasonable name found */ |
| 344 | } |
| 345 | |
| 346 | |
| 347 | static int filterpc (int pc, int jmptarget) { |
no test coverage detected