diff options
Diffstat (limited to 'external/mdds')
-rw-r--r-- | external/mdds/UnpackedTarball_mdds.mk | 1 | ||||
-rw-r--r-- | external/mdds/ofz-4048.patch.1 | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/external/mdds/UnpackedTarball_mdds.mk b/external/mdds/UnpackedTarball_mdds.mk index c015f4c13f5a..1958b32c2cb4 100644 --- a/external/mdds/UnpackedTarball_mdds.mk +++ b/external/mdds/UnpackedTarball_mdds.mk @@ -14,6 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL))) $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0)) $(eval $(call gb_UnpackedTarball_add_patches,mdds,\ + external/mdds/ofz-4048.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/mdds/ofz-4048.patch.1 b/external/mdds/ofz-4048.patch.1 new file mode 100644 index 000000000000..887a53ef9e28 --- /dev/null +++ b/external/mdds/ofz-4048.patch.1 @@ -0,0 +1,48 @@ +diff --git a/include/mdds/flat_segment_tree_def.inl b/include/mdds/flat_segment_tree_def.inl +index 58de366..00cc1c6 100644 +--- a/include/mdds/flat_segment_tree_def.inl ++++ b/include/mdds/flat_segment_tree_def.inl +@@ -778,7 +778,7 @@ bool flat_segment_tree<_Key, _Value>::adjust_segment_range(key_type& start_key, + // Invalid order of segment range. + return false; + +- if (end_key < m_left_leaf->value_leaf.key || start_key > m_right_leaf->value_leaf.key) ++ if (end_key < m_left_leaf->value_leaf.key || start_key >= m_right_leaf->value_leaf.key) + // The new segment does not overlap the current interval. + return false; + +diff --git a/src/flat_segment_tree_test.cpp b/src/flat_segment_tree_test.cpp +index bb29918..b94f0fd 100644 +--- a/src/flat_segment_tree_test.cpp ++++ b/src/flat_segment_tree_test.cpp +@@ -1986,6 +1986,22 @@ void fst_test_insert_out_of_bound() + pos = ret.first; + } + ++void fst_test_insert_out_of_bound_2() ++{ ++ stack_printer __stack_printer__("::fst_test_insert_out_of_bound_2"); ++ ++ typedef flat_segment_tree<int, bool> db_type; ++ db_type db(0, 256, false); ++ ++ // The range is entirely out-of-bound, but the start range equals the ++ // upper bound of the valid range. ++ auto ret = db.insert_back(256, 1024, true); ++ ++ // Insertion never took place. ++ assert(ret.first == db.end()); ++ assert(!ret.second); ++} ++ + void fst_test_segment_iterator() + { + stack_printer __stack_printer__("::fst_test_segment_iterator"); +@@ -2115,6 +2131,7 @@ int main (int argc, char **argv) + fst_test_assignment(); + fst_test_non_numeric_value(); + fst_test_insert_out_of_bound(); ++ fst_test_insert_out_of_bound_2(); + fst_test_segment_iterator(); + } + |