This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Some profile results: scm_sloppy_assq?


Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

> On 14 Jun 2000, Michael Livshin wrote:
> 
> > > I think scm_unprotect_object is broken:  It decrements the CAR of the
> > > handle, while in scm_protect_object the CDR is incremented.
> > 
> > eeek!  good catch.
> 
> Thanks :-)

well, thank _you_!  there! ;)

> It is surprising that we did not stumble across that error much earlier:  
> The way the wrong code 'worked' it should have led to a corrupted
> heap.

nope, it was much more insidious -- it didn't corrupt anything, it
just always decremented a pointer by 1 and compared the result to 0,
which never yielded true.

> In any case, it is an argument to extend the set of SCM_DEBUG macros in a
> way that we can make sure that calls to SCM_INUM and other similar macros 
> do an exhaustive argument check.  This, at least, would have caught that
> one.

good idea.

hmmm, I wonder if it would be better not to constrain the protection
counters to INUM's, or at least check the range...

-- 
programmer, n:
        A red eyed, mumbling mammal capable of conversing with inanimate
        monsters.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]