chiark / gitweb /
Do not invalidate string rep of shared objs.
authorian <ian>
Wed, 2 Oct 2002 00:08:31 +0000 (00:08 +0000)
committerian <ian>
Wed, 2 Oct 2002 00:08:31 +0000 (00:08 +0000)
base/parse.c
hbytes/parse.c

index 5e1f918..44f00e2 100644 (file)
@@ -42,11 +42,11 @@ int pat_hbv(Tcl_Interp *ip, Tcl_Obj *var, HBytes_Var *agg) {
   rc= Tcl_ConvertToType(ip,val,&hbytes_type);
   if (rc) return rc;
 
-  Tcl_InvalidateStringRep(val);
   if (Tcl_IsShared(val)) {
     val= Tcl_DuplicateObj(val);
     agg->copied= 1;
   }
+  Tcl_InvalidateStringRep(val);
   agg->obj= val;
 
   agg->hb= OBJ_HBYTES(val);
index 5e1f918..44f00e2 100644 (file)
@@ -42,11 +42,11 @@ int pat_hbv(Tcl_Interp *ip, Tcl_Obj *var, HBytes_Var *agg) {
   rc= Tcl_ConvertToType(ip,val,&hbytes_type);
   if (rc) return rc;
 
-  Tcl_InvalidateStringRep(val);
   if (Tcl_IsShared(val)) {
     val= Tcl_DuplicateObj(val);
     agg->copied= 1;
   }
+  Tcl_InvalidateStringRep(val);
   agg->obj= val;
 
   agg->hb= OBJ_HBYTES(val);