dylan-lang/opendylan — pull request #842 by waywardmonkeys (2014-12-29 00:41:40+00:00)
Title: [deuce] Fix out-of-bounds dline access.

This could get into a situation where, for example, max-y would be
99, line-y would be continually iterating and increasing and line-height
would be 1, since this was happening in terminal mode.

This is clearly an error in the code as this would happen when resizing:

let new-size ::
= min(max-y, floor(max(ceiling/(max-y, 10), n-slots * 1.5)));
let new-lines ::
= make(, size: new-size);

and then after new-lines is moved to be lines:

dline := lines[n-lines];

So, n-lines needs to be less than max-y and not potentially equal
to it. When line-height is 1, n-lines and line-y are growing at
the same rate and it is more clear that line-y must also remain
less than (and not less than or equal to) max-y.