MCPcopy Create free account
hub / github.com/F-Stack/f-stack / kname

Function kname

freebsd/contrib/openzfs/module/lua/ldebug.c:323–341  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

getobjnameFunction · 0.70

Calls 1

getobjnameFunction · 0.70

Tested by

no test coverage detected