Attachment "tclstack.patch" to
ticket [2030670fff]
added by
ajpasadyn
2008-07-29 03:23:44.
--- old/tcl8.5.3/generic/tclExecute.c 2008-07-28 14:11:37.735207100 -0500
+++ new/tcl8.5.3/generic/tclExecute.c 2008-07-28 14:13:35.128386700 -0500
@@ -915,6 +915,7 @@
int newBytes, newElems, currElems;
int needed = growth - (esPtr->endPtr - esPtr->tosPtr);
Tcl_Obj **markerPtr = esPtr->markerPtr, **memStart;
+ int moveWords = 0;
if (move) {
if (!markerPtr) {
@@ -949,9 +950,9 @@
*/
if (move) {
- move = esPtr->tosPtr - MEMSTART(markerPtr) + 1;
+ moveWords = esPtr->tosPtr - MEMSTART(markerPtr) + 1;
}
- needed = growth + move + WALLOCALIGN - 1;
+ needed = growth + moveWords + WALLOCALIGN - 1;
/*
* Check if there is enough room in the next stack (if there is one, it
@@ -1011,8 +1012,8 @@
esPtr->tosPtr = memStart - 1;
if (move) {
- memcpy(memStart, MEMSTART(markerPtr), move*sizeof(Tcl_Obj *));
- esPtr->tosPtr += move;
+ memcpy(memStart, MEMSTART(markerPtr), moveWords*sizeof(Tcl_Obj *));
+ esPtr->tosPtr += moveWords;
oldPtr->markerPtr = (Tcl_Obj **) *markerPtr;
oldPtr->tosPtr = markerPtr-1;
}