mirror of
https://github.com/boostorg/unordered.git
synced 2026-01-30 18:12:15 +01:00
Fix exception bug in asssignment.
The hash and key equality functions were assigned before allocating new buckets. If that allocation failed, then the existing elements would be left in place - so if accessed after the exception they could be in the wrong buckets or equivalent elements could be incorrectly grouped together.
This commit is contained in:
@@ -111,6 +111,12 @@ struct assign_test4 : assign_values<T>
|
||||
assign_test4() : assign_values<T>(10, 10, 1, 2) {}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct assign_test4a : assign_values<T>
|
||||
{
|
||||
assign_test4a() : assign_values<T>(10, 100, 1, 2) {}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct assign_test5 : assign_values<T>
|
||||
{
|
||||
@@ -136,7 +142,7 @@ struct equivalent_test1 : assign_base<T>
|
||||
|
||||
EXCEPTION_TESTS(
|
||||
(self_assign_test1)(self_assign_test2)
|
||||
(assign_test1)(assign_test2)(assign_test3)(assign_test4)(assign_test5)
|
||||
(assign_test1)(assign_test2)(assign_test3)(assign_test4)(assign_test4a)(assign_test5)
|
||||
(equivalent_test1),
|
||||
CONTAINER_SEQ)
|
||||
RUN_TESTS()
|
||||
|
||||
Reference in New Issue
Block a user