1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-26 08:41:47 -07:00

When pushing a stack frame, the frame pointer should be buffergetinit, not bufferscanlimit. spotted by rb in review <https://info.ravenbrook.com/mail/2015/09/21/14-13-55/0/>.

Copied from Perforce
 Change: 188351
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2015-09-22 21:24:50 +01:00
parent 2da2650d9e
commit ff29aac90b

View file

@ -544,13 +544,13 @@ static Res SNCFramePush(AllocFrame *frameReturn, Pool pool, Buffer buf)
AVER(sncBufferTopSeg(buf) == NULL); /* The stack must be empty */
/* Use NULL to indicate an empty stack. .lw-frame-null */
*frameReturn = NULL;
} else if (BufferScanLimit(buf) < SegLimit(BufferSeg(buf))) {
/* Use the scan limit as the lightweight frame pointer */
*frameReturn = (AllocFrame)BufferScanLimit(buf);
} else if (BufferGetInit(buf) < SegLimit(BufferSeg(buf))) {
/* Frame pointer is limit of initialized objects in buffer. */
*frameReturn = (AllocFrame)BufferGetInit(buf);
} else {
/* Can't use the scan limit as the lightweight frame pointer as
* it's not in the segment (see job003882). Instead, refill the
* buffer and put the frame pointer at the beginning. */
/* Can't use the limit of initialized objects as the frame pointer
* because it's not in the segment (see job003882). Instead, refill
* the buffer and put the frame pointer at the beginning. */
Res res;
Addr base, limit;
BufferDetach(buf, pool);
@ -558,8 +558,8 @@ static Res SNCFramePush(AllocFrame *frameReturn, Pool pool, Buffer buf)
if (res != ResOK)
return res;
BufferAttach(buf, base, limit, base, 0);
AVER(BufferScanLimit(buf) < SegLimit(BufferSeg(buf)));
*frameReturn = (AllocFrame)BufferScanLimit(buf);
AVER(BufferGetInit(buf) < SegLimit(BufferSeg(buf)));
*frameReturn = (AllocFrame)BufferGetInit(buf);
}
return ResOK;
}