summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2011-01-13 11:30:12 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2011-01-13 11:30:12 (GMT)
commit63b366c72bff6d044874c992d5a767695c977b22 (patch)
tree2eb77cfa949c60cd5d92fa1b6a54436590eaa350
parent4e2ff7a7961bc4bb13c14d2878976cebe3f0ddbd (diff)
downloadtcl-63b366c72bff6d044874c992d5a767695c977b22.zip
tcl-63b366c72bff6d044874c992d5a767695c977b22.tar.gz
tcl-63b366c72bff6d044874c992d5a767695c977b22.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. BACKPORT.
-rw-r--r--ChangeLog7
-rw-r--r--generic/tclExecute.c8
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0227878..525a166 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-13 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. BACKPORT.
+
2011-01-03 Jan Nijtmans <nijtmans@users.sf.net>
* tools/genStubs.tcl: Fix "make genstubs", which was broken
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 2f38758..3f9c439 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -13,7 +13,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.369.2.19 2010/11/15 21:32:31 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.369.2.20 2011/01/13 11:30:12 msofer Exp $
*/
#include "tclInt.h"
@@ -921,14 +921,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