aboutsummaryrefslogtreecommitdiff
path: root/src/ldebug.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-12 07:55:38 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-12 09:18:43 +0200
commitfc08312ebf8cf01a53b4826acce0f1c3aedcdc53 (patch)
tree5b1c3a1276037b482102bfe2c36bcb31c459acac /src/ldebug.js
parent58fcb1d7f55424de904fd6ae53954b46d82aae8c (diff)
downloadfengari-fc08312ebf8cf01a53b4826acce0f1c3aedcdc53.tar.gz
fengari-fc08312ebf8cf01a53b4826acce0f1c3aedcdc53.tar.bz2
fengari-fc08312ebf8cf01a53b4826acce0f1c3aedcdc53.zip
debug.traceback
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) {