summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2010-12-30 23:10:06 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2010-12-30 23:10:06 (GMT)
commitef058dce40109ef6ead33a01b03382c34ba5cf02 (patch)
tree1ec51f45b85eeae695bdf77f8d3ed39a5a979853
parent6ddeb240a8b2366627697111435c5da9aa575dd0 (diff)
downloadtcl-ef058dce40109ef6ead33a01b03382c34ba5cf02.zip
tcl-ef058dce40109ef6ead33a01b03382c34ba5cf02.tar.gz
tcl-ef058dce40109ef6ead33a01b03382c34ba5cf02.tar.bz2
* generic/tclExecute.c (GrowEvaluationStack): off-by-one error in
sizing the new allocation - was ok in comment but wrong in the code. Triggered by [Bug 3142026] which happened to require exactly one more than what was in existence.
-rw-r--r--ChangeLog7
-rw-r--r--generic/tclExecute.c8
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c52dd99..fd7a410 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-12-30 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclExecute.c (GrowEvaluationStack): off-by-one error in
+ sizing the new allocation - was ok in comment but wrong in the
+ code. Triggered by [Bug 3142026] which happened to require
+ exactly one more than what was in existence.
+
2010-12-26 Donal K. Fellows <dkf@users.sf.net>
* generic/tclCmdIL.c (Tcl_LsortObjCmd): Fix crash when multiple -index
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 884c7d5..8561bd4 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.510 2010/11/15 21:34:54 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.511 2010/12/30 23:10:07 msofer Exp $
*/
#include "tclInt.h"
@@ -1062,14 +1062,14 @@ GrowEvaluationStack(
/*
* Reset move to hold the number of words to be moved to new stack (if
- * any) and growth to hold the complete stack requirements: add the marker
- * and maximal possible offset.
+ * any) and growth to hold the complete stack requirements: add one for
+ * the marker, (WALLOCALIGN-1) for the maximal possible offset.
*/
if (move) {
moveWords = esPtr->tosPtr - MEMSTART(markerPtr) + 1;
}
- needed = growth + moveWords + WALLOCALIGN - 1;
+ needed = growth + moveWords + WALLOCALIGN;
/*
* Check if there is enough room in the next stack (if there is one, it