Mail Archives: djgpp/1992/02/19/11:29:56
It seems to me that a similar bug exists in the XMS calculations. In
xms_alloc_init,
pn_hi_first = (linear_base + 4095)/4096;
pn_hi_last = pn_hi_first + emb_size / 4 - 1;
should be
pn_hi_first = (linear_base + 4095)/4096;
pn_hi_last = (linear_base + emb_size * 1024L)/4096 - 1;
Computing pn_hi_last from a base of pn_hi_first is wrong because it
effectively assumes up to 4095 more bytes are available. Consider when
linear_base == 1 and emb_size == 4 -- there are no valid pages! It may
be that XMS managers put things on 4k boundaries anyway, so we haven't
experienced problems with this, but the calculations don't need to
assume that.
- Raw text -