diff options
author | hobbs <hobbs> | 2000-06-06 19:34:34 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-06-06 19:34:34 (GMT) |
commit | e112a3100eab65d51f74c378b94fdf1dd95b6cc8 (patch) | |
tree | f6060bf7415490600806c59b43c5c2c7d328ab90 /generic/tclIndexObj.c | |
parent | 84527799d555b4835aee38dcc7d524adc135d571 (diff) | |
download | tcl-e112a3100eab65d51f74c378b94fdf1dd95b6cc8.zip tcl-e112a3100eab65d51f74c378b94fdf1dd95b6cc8.tar.gz tcl-e112a3100eab65d51f74c378b94fdf1dd95b6cc8.tar.bz2 |
* generic/tclIndexObj.c (Tcl_GetIndexFromObjStruct): Corrected
caching of the index ptr to account for offsets != sizeof(char *).
[Bug: 5153]
Diffstat (limited to 'generic/tclIndexObj.c')
-rw-r--r-- | generic/tclIndexObj.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index eedb259..7e60153 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.5 2000/06/06 19:34:34 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; |