File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ typedef struct {
73
73
#define NEXT_ENTRY (table , offset ) \
74
74
(&(STRING_AT(table, offset)))
75
75
#define EXPAND_OF (indexRep ) \
76
- STRING_AT((indexRep)->tablePtr, (indexRep)->offset*(indexRep)->index)
76
+ (((indexRep)->index >= 0) ? STRING_AT((indexRep)->tablePtr, (indexRep)->offset*(indexRep)->index) : "" )
77
77
78
78
/*
79
79
*----------------------------------------------------------------------
@@ -284,7 +284,9 @@ Tcl_GetIndexFromObjStruct(
284
284
irPtr = TclFetchInternalRep (objPtr , & indexType );
285
285
if (irPtr ) {
286
286
indexRep = (IndexRep * )irPtr -> twoPtrValue .ptr1 ;
287
- if (indexRep -> tablePtr == tablePtr && indexRep -> offset == offset ) {
287
+ if ((indexRep -> tablePtr == tablePtr )
288
+ && (indexRep -> offset == offset )
289
+ && (indexRep -> index >= 0 )) {
288
290
* indexPtr = indexRep -> index ;
289
291
return TCL_OK ;
290
292
}
@@ -344,7 +346,7 @@ Tcl_GetIndexFromObjStruct(
344
346
* operation.
345
347
*/
346
348
347
- if (objPtr && !(flags & TCL_INDEX_TEMP_TABLE )) {
349
+ if (objPtr && ( index >= 0 ) && !(flags & TCL_INDEX_TEMP_TABLE )) {
348
350
irPtr = TclFetchInternalRep (objPtr , & indexType );
349
351
if (irPtr ) {
350
352
indexRep = (IndexRep * )irPtr -> twoPtrValue .ptr1 ;
You can’t perform that action at this time.
0 commit comments