Skip to content

Commit

Permalink
fix recursion error
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann committed Jun 11, 2022
1 parent 9c67d51 commit 2d99e3f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## Changelog

### [1.0.1] - 2022-04-
### [1.0.2] - 2022-06-11
#### Fixed
- fix unlimited recursion in CachedLCSseq::similarity
- reduce compiler warnings

### [1.0.1] - 2022-04-16
#### Fixed
- fix undefined behavior in sorted_split incrementing iterator past the end
- fix use after free in editops calculation
Expand Down
6 changes: 3 additions & 3 deletions extras/rapidfuzz_amalgamated.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
// SPDX-License-Identifier: MIT
// RapidFuzz v1.0.1
// Generated: 2022-06-09 23:04:10.629372
// RapidFuzz v1.0.2
// Generated: 2022-06-11 16:04:44.231692
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
Expand Down Expand Up @@ -2779,7 +2779,7 @@ int64_t CachedLCSseq<CharT1>::distance(InputIt2 first2, InputIt2 last2, int64_t
{
int64_t maximum = std::max<int64_t>(s1.size(), std::distance(first2, last2));
int64_t cutoff_distance = maximum - score_cutoff;
int64_t sim = maximum - distance(first2, last2, cutoff_distance);
int64_t sim = maximum - similarity(first2, last2, cutoff_distance);
return (sim >= score_cutoff) ? sim : 0;
}

Expand Down
2 changes: 1 addition & 1 deletion rapidfuzz/distance/LCSseq.impl
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ int64_t CachedLCSseq<CharT1>::distance(InputIt2 first2, InputIt2 last2, int64_t
{
int64_t maximum = std::max<int64_t>(s1.size(), std::distance(first2, last2));
int64_t cutoff_distance = maximum - score_cutoff;
int64_t sim = maximum - distance(first2, last2, cutoff_distance);
int64_t sim = maximum - similarity(first2, last2, cutoff_distance);
return (sim >= score_cutoff) ? sim : 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tools/amalgamation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys

root_path = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))
version_string = "1.0.1"
version_string = "1.0.2"

starting_header = os.path.join(root_path, 'rapidfuzz', 'rapidfuzz_all.hpp')
output_header = os.path.join(root_path, 'extras', 'rapidfuzz_amalgamated.hpp')
Expand Down

0 comments on commit 2d99e3f

Please sign in to comment.