diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-03-24 22:04:56 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-03-24 22:04:56 +0000 |
| commit | ccb53eca42da9cdd7147d8a3b197bc455d62fad9 (patch) | |
| tree | c9798cbdb25af7ab1518ddb3acef8d5c8c562070 | |
| parent | 840b7658fdf46c60feeee3335ab55068e24cc27d (diff) | |
Fix uninitialized value in RankedMatch
| -rw-r--r-- | src/ranked_match.cc | 2 | ||||
| -rw-r--r-- | src/ranked_match.hh | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/ranked_match.cc b/src/ranked_match.cc index aacf3cae..9454b270 100644 --- a/src/ranked_match.cc +++ b/src/ranked_match.cc @@ -91,6 +91,8 @@ RankedMatch::RankedMatch(StringView candidate, StringView query) bool RankedMatch::operator<(const RankedMatch& other) const { + kak_assert((bool)*this and (bool)other); + if (m_prefix != other.m_prefix) return m_prefix; diff --git a/src/ranked_match.hh b/src/ranked_match.hh index 85dab5e2..de03fd4c 100644 --- a/src/ranked_match.hh +++ b/src/ranked_match.hh @@ -21,7 +21,7 @@ private: bool m_first_char_match = false; bool m_prefix = false; int m_word_boundary_match_count = 0; - int m_match_index_sum; + int m_match_index_sum = 0; bool m_only_word_boundary = false; }; |
