diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-08-30 23:02:16 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-08-30 23:02:16 (GMT) |
| commit | 4f320507252b9d045785f3606b57bd776c30f64b (patch) | |
| tree | 85f3f6b5b7d552703c7704028f51bb2865d4d22f | |
| parent | 33fa3f7f1fd8342215ce4fe948434c6c87274deb (diff) | |
| download | tcl-4f320507252b9d045785f3606b57bd776c30f64b.zip tcl-4f320507252b9d045785f3606b57bd776c30f64b.tar.gz tcl-4f320507252b9d045785f3606b57bd776c30f64b.tar.bz2 | |
Apply patch 0006 from [37108037b9]: Code cleanups to support CHERI
| -rw-r--r-- | generic/tclExecute.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 27ebeec..8aa3bb2 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2720,7 +2720,8 @@ TEBCresume( case INST_EXPAND_STKTOP: { int i; - ptrdiff_t moved; + TEBCdata *newTD; + ptrdiff_t oldCatchTopOff, oldTosPtrOff; /* * Make sure that the element at stackTop is a list; if not, just @@ -2749,19 +2750,21 @@ TEBCresume( + codePtr->maxStackDepth /* Beyond the original max */ - CURR_DEPTH; /* Relative to where we are */ DECACHE_STACK_INFO(); - moved = GrowEvaluationStack(iPtr->execEnvPtr, length, 1) - - (Tcl_Obj **) TD; - if (moved) { + oldCatchTopOff = catchTop - initCatchTop; + oldTosPtrOff = tosPtr - initTosPtr; + newTD = (TEBCdata *) + GrowEvaluationStack(iPtr->execEnvPtr, length, 1); + if (newTD != TD) { /* * Change the global data to point to the new stack: move the * TEBCdataPtr TD, recompute the position of every other * stack-allocated parameter, update the stack pointers. */ - TD = (TEBCdata *) (((Tcl_Obj **)TD) + moved); + TD = newTD; - catchTop += moved; - tosPtr += moved; + catchTop = initCatchTop + oldCatchTopOff; + tosPtr = initTosPtr + oldTosPtrOff; } } |
