summaryrefslogtreecommitdiff
path: root/src/ldebug.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ldebug.js')
-rw-r--r--src/ldebug.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ldebug.js b/src/ldebug.js
index 5a5fc34..ce62abc 100644
--- a/src/ldebug.js
+++ b/src/ldebug.js
@@ -194,10 +194,13 @@ const auxgetinfo = function(L, what, ar, f, ci) {
break;
}
case 'n': {
- ar.namewhat = getfuncname(L, ci, ar.name);
- if (ar.namewhat === null) {
- ar.namewhat = [];
+ let r = getfuncname(L, ci);
+ if (r === null) {
+ ar.namewhat = null;
ar.name = null;
+ } else {
+ ar.namewhat = r.funcname;
+ ar.name = r.name;
}
break;
}
@@ -395,7 +398,7 @@ const funcnamefromcode = function(L, ci) {
let tm = 0; /* (initial value avoids warnings) */
let p = ci.func.p; /* calling function */
- let pc = ci.pcOff; /* calling instruction index */
+ let pc = ci.pcOff - 1; /* calling instruction index */
let i = p.code[pc]; /* calling instruction */
if (ci.callstatus & lstate.CIST_HOOKED) {