[dylan-lang/opendylan] 0b529c: [deuce] Fix out-of-bounds dline access.
GitHub <[email protected]>
| Newsgroups | gmane.comp.lang.dylan.gwydion.cvs |
|---|---|
| Message-ID | <54a0a3312e0ad_6bdc3fbc281ed2b825581@hookshot-fe3-cp1-prd.iad.github.net.mail> |
Branch: refs/heads/deuce-dline-fix
Home: https://github.com/dylan-lang/opendylan
Commit: 0b529c31fd15a91e2717d6c86ae10b44b30a95f0
https://github.com/dylan-lang/opendylan/commit/0b529c31fd15a91e2717d6c86ae10b44b30a95f0
Author: Bruce Mitchener <[email protected]>
Date: 2014-12-28 (Sun, 28 Dec 2014)
Changed paths:
M sources/deuce/display.dylan
Log Message:
-----------
[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 :: <integer>
= min(max-y, floor(max(ceiling/(max-y, 10), n-slots * 1.5)));
let new-lines :: <simple-object-vector>
= make(<simple-object-vector>, 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.
_______________________________________________
chatter mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/chatter