This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Some profile results: scm_sloppy_assq?
- To: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Subject: Re: Some profile results: scm_sloppy_assq?
- From: Michael Livshin <mlivshin at bigfoot dot com>
- Date: 14 Jun 2000 18:02:17 +0200
- Cc: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>, Jan Nieuwenhuizen <janneke at gnu dot org>, Guile Mailing List <guile at sourceware dot cygnus dot com>, "ir. Wendy" <hanwen at cs dot uu dot nl>
- Organization: who? me?
- References: <Pine.LNX.4.21.0006141629360.23187-100000@marvin.ida.ing.tu-bs.de>
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.