>>>> "GE" == Gunnar Evermann
<ge204(a)eng.cam.ac.uk> writes:
GE> Maybe I am misreading the code but I think the ++specpdl_ stuff in
GE> unbind_to_hairy() is necessary because it is called from the
GE> UNBIND_TO* macros.
Right.
GE> my interpretation of the code is:
GE> - the UNBIND_TO* macros handle the normal variable case.
GE> - unbind_to_hairy() is basically the old (pre-marzilla patch)
GE> unbind_to()
GE> - in UNBIND_TO* we first decrement the specpdl counters and then only
GE> if we are not dealing with a normal variable call
GE> unbind_to_hairy(). The first thing unbind_to_hairy() has to do is to
GE> undo the decrement done in the macro.
GE> Martin, I'd suggest to move the increments into the macros to make
GE> this more obvious.
But that would make the macro a nanosecond slower by making it expand
to larger code. We could of course add a comment for clarity instead.
GE> Ben, am I missing something here? What did you mean by 'logic error'?
It's of course still possible that there's a specpdl logic error here,
given that no one really understands the code. But it's probably more
subtle.
Maybe it has to do with the #if 0 I wrapped around the following code
in unbind_to_hairy(). My assumption was that if this broke, we would
find out rather quickly - and it's been more than a year now...
#if 0 /* martin */
#ifndef EXCEEDINGLY_QUESTIONABLE_CODE
/* There should never be anything here for us to remove.
If so, it indicates a logic error in Emacs. Catches
should get removed when a throw or signal occurs, or
when a catch or condition-case exits normally. But
it's too dangerous to just remove this code. --ben */
/* Furthermore, this code is not in FSFmacs!!!
Braino on mly's part? */
/* If we're unwound past the pdlcount of a catch frame,
that catch can't possibly still be valid. */
while (catchlist && catchlist->pdlcount > specpdl_depth_counter)
{
catchlist = catchlist->next;
/* Don't mess with gcprolist, backtrace_list here */
}
#endif
#endif