Repository navigation
bugfix: change LazyOffsetArrayIter16 to ignore null offsets - #212
Conversation
|
Merging, with one fix I'll apply on top immediately. The bug is worse than the title says. This is not "a NULL offset yields something wrong" — a NULL offset terminates the entire iteration. That matters because NULL is explicitly spec-legal in four of the thirteen arrays this type backs: I checked the index-alignment risk carefully, since skipping entries is exactly the kind of change that misaligns a caller indexing in parallel. In-crate there is none: the only consumer of this iterator is the The one thing that must change, and why I'm doing it rather than asking you to. The PR fixes fn count(self) -> usize {
usize::from(self.array.len().saturating_sub(self.index))
}
Also worth stating plainly for the changelog: the implementation skips on any On the Rebases clean; |
I doubt there ever will be a release, tbh. But in the current state of things you can work around this by continuing to push the iterator after it returns |
this changes the
nextfunction inLazyOffsetArrayIter16to ignoreNonevalues in the array. All tests pass in tif-parser and rustybuzz. no code changes required in rustybuzz.closes #211 , as I noticed none of call sites in rustybuzz expect a non-fused iterator. (they're mostly
collectandanycalls).Edit:
Looking at the implementation of the corresponding data structure in read-fonts, it does not skip over the null offsets. However, all usage I could find
maporfilter_mapexcept in a test).