summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-03-18 17:58:29 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-03-18 17:58:29 (GMT)
commit873209b55747301a12c4b542a16c8fea6c0c97db (patch)
treee8fcbdef0c4f2ad29515a2fce63afe55086f434d /generic/tclExecute.c
parent38a014652e47c230d1fbd41569a36157eb4275f3 (diff)
downloadtcl-873209b55747301a12c4b542a16c8fea6c0c97db.zip
tcl-873209b55747301a12c4b542a16c8fea6c0c97db.tar.gz
tcl-873209b55747301a12c4b542a16c8fea6c0c97db.tar.bz2
* generic/tclExecute.c: Patch from Miguel Sofer to correct the
alignment of memory allocated by GrowEvaluationStack(). [Bug 1914503]
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 10be147..31df1a7 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.367 2008/03/10 14:34:26 dgp Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.368 2008/03/18 17:58:30 dgp Exp $
*/
#include "tclInt.h"
@@ -862,16 +862,9 @@ static inline int
OFFSET(
Tcl_Obj **markerPtr)
{
- /*
- * Note that we are only interested in the low bits of the address, so
- * that the fact that PTR2INT may lose the high bits is irrelevant.
- */
-
- int mask, base, new;
-
- mask = WALLOCALIGN-1;
- base = (PTR2INT(markerPtr) & mask);
- new = ((base + 1) + mask) & ~mask;
+ int mask = TCL_ALLOCALIGN-1;
+ int base = PTR2INT(markerPtr) & 0xFFFFFF;
+ int new = (base + TCL_ALLOCALIGN) & ~mask;
return (new - base);
}