* libguile/stacks.c (stack_depth): Decrement depth count for a
macro-expansion frame. (Missing this decrement will cause a "stack
count incorrect" warning but is actually benign, as it only means
that scm_make_stack allocates a bit more space for the stack than it
really needs.)
(read_frames): Increment count of remaining unused frames, when
cutting out a macro transformer application frame. (Missing this
increment could cause the "stack count incorrect" warning, and could
make read_frames think it's filled up all the available stack frames
when there's actually still one frame unused; this wasn't benign,
because it could cause information to be missing from a stack
trace.)
{
scm_t_debug_info *info = RELOC_INFO (dframe->info, offset);
scm_t_debug_info *vect = RELOC_INFO (dframe->vect, offset);
+ /* If current frame is a macro during expansion, we should
+ skip the previously recorded macro transformer
+ application frame. */
+ if (SCM_MACROEXPP (*dframe) && n > 0)
+ --n;
n += (info - vect) / 2 + 1;
/* Data in the apply part of an eval info frame comes from previous
stack frame if the scm_t_debug_info vector is overflowed. */
{
*(iframe - 1) = *iframe;
--iframe;
+ ++n;
}
info = RELOC_INFO (dframe->info, offset);
vect = RELOC_INFO (dframe->vect, offset);