On Apr 9, 2005 8:36 AM, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote:
> 
> Am 04.04.2005 um 03:16 schrieb Stephen Deasey:
> 
> > I haven't figured this out yet :-(
> > It's probably going to be next week before I can take another look.
> >
> >
> 
> Hmmm... just went on Purify trip and unfortunately no cigar.
> But...
> 
> I was experimenting somehow, and looking parallel into some
> of our code and Tcl's code about obj handling.
> There are two places I found:
> 
> RCS file: /cvsroot/naviserver/naviserver/nsd/tclobj.c,v
> retrieving revision 1.2
> diff -r1.2 tclobj.c
> 123c123
> <         (typePtr->freeIntRepProc)(objPtr);
> ---
>  >         (*typePtr->freeIntRepProc)(objPtr);
> 
> I wonder how this *ever* worked before? I doubt
> that anybody seriously used that.


I think these two are equivalent, but only because they're function
pointers.  The dereferencing style is consistent with the rest of the
source though.


> Another thing: I do not think you should free the string rep
> of the object by just calling the Tcl_ConvertToType (which
> eventually calls SetSpecFromAny()). I modified the SetSpecFromAny()
> to skip forcefully invalidating the string rep and now it works.


Hmm, I think I added that to force a canonicalisation of the string
rep, but it doesn't seem necessary (to say the least!).

Take a look at tclobj.c: SetTimeInternalRep() -- it also invalidates
it's string rep.  I wonder why this has never shown up as an error...?


> Also, in FreeSpecObj, it is necessary to zero-out the ptr1/ptr2
> after freeing them since this will bring up the real problem sooner
> on the surface. Besides, it is also cleaner.
> 
> I've checked those changes. Please have a look and see if this
> is OK for you.


Tests pass for me.  Thanks!

Reply via email to