summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 58d85e1..d65469c 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -177,22 +177,24 @@ typedef struct TEBCdata {
ptrdiff_t *catchTop; /* These fields are used on return TO this */
Tcl_Obj *auxObjList; /* this level: they record the state when a */
CmdFrame cmdFrame; /* new codePtr was received for NR */
- /* execution. */
+ int numLevels; /* execution. */
void *stack[1]; /* Start of the actual combined catch and obj
* stacks; the struct will be expanded as
* necessary */
} TEBCdata;
#define TEBC_YIELD() \
- do { \
- esPtr->tosPtr = tosPtr; \
- TclNRAddCallback(interp, TEBCresume, \
- TD, pc, INT2PTR(cleanup), NULL); \
+ do { \
+ esPtr->tosPtr = tosPtr; \
+ TD->numLevels = ((Interp *) interp)->numLevels; \
+ TclNRAddCallback(interp, TEBCresume, \
+ TD, pc, INT2PTR(cleanup), NULL); \
} while (0)
#define TEBC_DATA_DIG() \
- do { \
- tosPtr = esPtr->tosPtr; \
+ do { \
+ ((Interp *) interp)->numLevels = TD->numLevels; \
+ tosPtr = esPtr->tosPtr; \
} while (0)
#define PUSH_TAUX_OBJ(objPtr) \
@@ -2084,6 +2086,7 @@ TclNRExecuteByteCode(
TD->codePtr = codePtr;
TD->catchTop = initCatchTop;
TD->auxObjList = NULL;
+ TD->numLevels = ((Interp *) interp)->numLevels;
/*
* TIP #280: Initialize the frame. Do not push it yet: it will be pushed
@@ -2980,6 +2983,7 @@ TEBCresume(
cleanup = 1;
pc++;
TEBC_YIELD();
+ ((Interp *) interp)->numLevels++;
return TclNRExecuteByteCode(interp, newCodePtr);
}
@@ -2995,6 +2999,7 @@ TEBCresume(
cleanup = 1;
pc += 1;
TEBC_YIELD();
+ ((Interp *) interp)->numLevels++;
return TclNREvalObjEx(interp, OBJ_AT_TOS, 0, NULL, 0);
case INST_INVOKE_EXPANDED: