@@ -858,7 +858,7 @@ fn apply_lookup(
858
858
859
859
// All positions are distance from beginning of *output* buffer.
860
860
// Adjust.
861
- let mut end = {
861
+ let mut end: isize = {
862
862
let backtrack_len = ctx. buffer . backtrack_len ( ) ;
863
863
let delta = backtrack_len as isize - ctx. buffer . idx as isize ;
864
864
@@ -867,7 +867,7 @@ fn apply_lookup(
867
867
match_positions[ j] = ( match_positions[ j] as isize + delta) as _ ;
868
868
}
869
869
870
- backtrack_len + match_end - ctx. buffer . idx
870
+ backtrack_len as isize + match_end as isize - ctx. buffer . idx as isize
871
871
} ;
872
872
873
873
for record in lookups {
@@ -928,8 +928,8 @@ fn apply_lookup(
928
928
//
929
929
// It should be possible to construct tests for both of these cases.
930
930
931
- end = end . saturating_add_signed ( delta) ;
932
- if end < match_positions[ idx] {
931
+ end += delta;
932
+ if end < match_positions[ idx] as isize {
933
933
// End might end up being smaller than match_positions[idx] if the recursed
934
934
// lookup ended up removing many items.
935
935
// Just never rewind end beyond start of current position, since that is
@@ -939,7 +939,7 @@ fn apply_lookup(
939
939
// https://github.com/harfbuzz/harfbuzz/issues/1611
940
940
//
941
941
delta += match_positions[ idx] as isize - end as isize ;
942
- end = match_positions[ idx] ;
942
+ end = match_positions[ idx] as isize ;
943
943
}
944
944
945
945
// next now is the position after the recursed lookup.
@@ -977,7 +977,7 @@ fn apply_lookup(
977
977
}
978
978
}
979
979
980
- ctx. buffer . move_to ( end) ;
980
+ ctx. buffer . move_to ( end as usize ) ;
981
981
}
982
982
983
983
/// Value represents glyph class.
0 commit comments