summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-08-07 21:33:15 (GMT)
committerhobbs <hobbs>2000-08-07 21:33:15 (GMT)
commit913b10b86350bb3cf0f61611e4abb8fde065b171 (patch)
tree1eee91906b2cab6c8f4d579a40a6533f819a6a85
parent9e21fa252fd5fa9625a5d185502a6a52aabf94b2 (diff)
downloadtcl-913b10b86350bb3cf0f61611e4abb8fde065b171.zip
tcl-913b10b86350bb3cf0f61611e4abb8fde065b171.tar.gz
tcl-913b10b86350bb3cf0f61611e4abb8fde065b171.tar.bz2
* generic/tclIndexObj.c (Tcl_GetIndexFromObjStruct): Corrected
caching of the index ptr to account for offsets != sizeof(char *). [Bug: 5153]
-rw-r--r--generic/tclIndexObj.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index eedb259..d0bc2a1 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIndexObj.c,v 1.4 1999/06/28 23:49:31 redman Exp $
+ * RCS: @(#) $Id: tclIndexObj.c,v 1.4.10.1 2000/08/07 21:33:15 hobbs Exp $
*/
#include "tclInt.h"
@@ -213,7 +213,11 @@ Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags,
objPtr->typePtr->freeIntRepProc(objPtr);
}
objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tablePtr;
- objPtr->internalRep.twoPtrValue.ptr2 = (VOID *) index;
+ /*
+ * Make sure to account for offsets != sizeof(char *). [Bug 5153]
+ */
+ objPtr->internalRep.twoPtrValue.ptr2 =
+ (VOID *) (index * (offset / sizeof(char *)));
objPtr->typePtr = &tclIndexType;
*indexPtr = index;
return TCL_OK;