--- tclIndexObj.c.old	Wed Feb 27 21:11:25 2002
+++ tclIndexObj.c	Fri Sep 26 06:12:33 2003
@@ -175,7 +175,6 @@
     char *key, *p1;
     CONST char *p2;
     CONST char * CONST *entryPtr;
-    Tcl_Obj *resultPtr;
     IndexRep *indexRep;
 
     /*
@@ -271,7 +270,8 @@
 	 * Produce a fancy error message.
 	 */
 	int count;
-	resultPtr = Tcl_GetObjResult(interp);
+	Tcl_Obj* resultPtr = Tcl_NewObj();
+
 	Tcl_AppendStringsToObj(resultPtr,
 		(numAbbrev > 1) ? "ambiguous " : "bad ", msg, " \"",
 		key, "\": must be ", STRING_AT(tablePtr,offset,0), (char*)NULL);
@@ -287,6 +287,8 @@
 			(char *) NULL);
 	    }
 	}
+
+	Tcl_SetObjResult(interp, resultPtr);
     }
     return TCL_ERROR;
 }
