From 36123908888d2f67eb72eaf5ace09569487ced2e Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 31 Aug 2024 09:40:46 +0100 Subject: [PATCH] #948 Bug in queue pop can break queue.empty() --- include/etl/queue.h | 2 +- include/etl/stack.h | 2 +- include/etl/version.h | 2 +- library.json | 2 +- library.properties | 2 +- support/Release notes.txt | 6 ++++++ version.txt | 2 +- 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/etl/queue.h b/include/etl/queue.h index 0f66cef1..b704d8a1 100644 --- a/include/etl/queue.h +++ b/include/etl/queue.h @@ -454,7 +454,7 @@ namespace etl void pop() { #if defined(ETL_CHECK_PUSH_POP) - ETL_ASSERT(!empty(), ETL_ERROR(queue_empty)); + ETL_ASSERT_OR_RETURN(!empty(), ETL_ERROR(queue_empty)); #endif p_buffer[out].~T(); del_out(); diff --git a/include/etl/stack.h b/include/etl/stack.h index f7c2bd62..a292218a 100644 --- a/include/etl/stack.h +++ b/include/etl/stack.h @@ -401,7 +401,7 @@ namespace etl void pop() { #if defined(ETL_CHECK_PUSH_POP) - ETL_ASSERT(!empty(), ETL_ERROR(stack_empty)); + ETL_ASSERT_OR_RETURN(!empty(), ETL_ERROR(stack_empty)); #endif p_buffer[top_index].~T(); base_t::del_out(); diff --git a/include/etl/version.h b/include/etl/version.h index c6c0df64..db5ed6d7 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -40,7 +40,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 20 #define ETL_VERSION_MINOR 39 -#define ETL_VERSION_PATCH 3 +#define ETL_VERSION_PATCH 4 #define ETL_VERSION ETL_STRING(ETL_VERSION_MAJOR) "." ETL_STRING(ETL_VERSION_MINOR) "." ETL_STRING(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_WIDE_STRING(ETL_VERSION_MAJOR) L"." ETL_WIDE_STRING(ETL_VERSION_MINOR) L"." ETL_WIDE_STRING(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index 74c2b1ee..12bca01e 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "20.39.3", + "version": "20.39.4", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index 670beb80..99401ff4 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=20.39.3 +version=20.39.4 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 021938d5..07aad137 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,4 +1,10 @@ =============================================================================== +20.39.4 + +#948 Bug in queue pop can break queue.empty() + Also included etl::stack in the fix. + +=============================================================================== 20.39.3 Updates: diff --git a/version.txt b/version.txt index 2a51ae30..55ed5f72 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -20.39.3 +20.39.4