MCPcopy Create free account
hub / github.com/DFHack/dfhack / kname

Function kname

depends/lua/src/ldebug.c:356–373  ·  view source on GitHub ↗

** find a "name" for the RK value 'c' */

Source from the content-addressed store, hash-verified

354** find a "name" for the RK value 'c'
355*/
356static 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
376static int filterpc (int pc, int jmptarget) {

Callers 1

getobjnameFunction · 0.85

Calls 1

getobjnameFunction · 0.85

Tested by

no test coverage detected