diff --git a/include/etl/stack.h b/include/etl/stack.h index 901e0e62..8c57dbd5 100644 --- a/include/etl/stack.h +++ b/include/etl/stack.h @@ -447,8 +447,7 @@ namespace etl istack& operator = (istack&& rhs) { if (&rhs != this) - { - clear(); + { clone(etl::move(rhs)); } @@ -463,6 +462,8 @@ namespace etl //************************************************************************* void clone(const istack& other) { + clear(); + size_t index = 0; for (size_t i = 0; i < other.size(); ++i) @@ -477,6 +478,8 @@ namespace etl //************************************************************************* void clone(istack&& other) { + clear(); + size_t index = 0; for (size_t i = 0; i < other.size(); ++i) diff --git a/include/etl/version.h b/include/etl/version.h index 07c33a62..3b339338 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 18 #define ETL_VERSION_MINOR 12 -#define ETL_VERSION_PATCH 5 +#define ETL_VERSION_PATCH 6 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index f024aaba..a7799bed 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "18.12.5", + "version": "18.12.6", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index 6deb9856..dcb166c2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=18.12.5 +version=18.12.6 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 360d40d4..216d9d4b 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +18.12.6 +Fixed etl::stack top level assignment operator not clearing before copy. + =============================================================================== 18.12.5 Fixed issue for incorrect operation of erase(const_iterator, const_iterator) when diff --git a/test/test_queue.cpp b/test/test_queue.cpp index f47a2842..2cf4824c 100644 --- a/test/test_queue.cpp +++ b/test/test_queue.cpp @@ -485,6 +485,10 @@ namespace etl::queue queue2; + // These should be overwritten. + queue2.push(5); + queue2.push(6); + queue2 = queue; CHECK(queue.size() == queue2.size()); diff --git a/test/test_stack.cpp b/test/test_stack.cpp index e0138830..c1b187fb 100644 --- a/test/test_stack.cpp +++ b/test/test_stack.cpp @@ -437,6 +437,10 @@ namespace etl::stack stack2; + // These should be overwritten. + stack2.push(5); + stack2.push(6); + stack2 = stack; CHECK(stack.size() == stack2.size());