3 source/interpret.c | 19 +++++++++++++------
4 1 file changed, 13 insertions(+), 6 deletions(-)
6 diff --quilt old/source/interpret.c new/source/interpret.c
7 --- old/source/interpret.c
8 +++ new/source/interpret.c
9 @@ -3106,6 +3106,7 @@ static char *stackDumpStr(DataValue *fp,
17 @@ -3117,9 +3118,12 @@ static char *stackDumpStr(DataValue *fp,
19 /* first measure the lengths */
20 len = strlen(msg) + 1;
21 - for (nfp = fp; nfp; nfp = FP_GET_OLD_FP(nfp)) {
24 len = len + FP_GET_ITEM(nfp, FP_FUNCTION_NAME).val.str.len + 1;
26 + pc = FP_GET_RET_PC(nfp);
27 + nfp = FP_GET_OLD_FP(nfp);
32 @@ -3134,12 +3138,15 @@ static char *stackDumpStr(DataValue *fp,
36 - for (nfp = fp; nfp; nfp = FP_GET_OLD_FP(nfp)) {
40 op = FP_GET_ITEM(nfp, FP_FUNCTION_NAME).val.str.rep;
44 + pc = FP_GET_RET_PC(nfp);
45 + nfp = FP_GET_OLD_FP(nfp);
50 @@ -3427,8 +3434,8 @@ static void disasm(Inst *inst, int nInst
51 static void stackdumpframe(DataValue *arrow, DataValue *outpt, DataValue *fp,
52 DataValue *sp, char topMark)
54 - DataValue *baseF = &FP_GET_ITEM(fp, FP_OLD_FP_INDEX);
55 - DataValue *oldFP = baseF ? baseF->val.dataval : NULL;
56 + Inst *retPC = FP_GET_RET_PC(fp);
57 + DataValue *oldFP = retPC ? FP_GET_OLD_FP(fp) : NULL;
58 DataValue *arg1 = &FP_GET_ARG_N(fp, 0);
59 DataValue *fnNm = &FP_GET_ITEM(fp, FP_FUNCTION_NAME);