diff --git a/CMakeLists.txt b/CMakeLists.txt index 283b44d..11d97b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(blt-gp VERSION 0.0.19) +project(blt-gp VERSION 0.0.20) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) diff --git a/include/blt/gp/stack.h b/include/blt/gp/stack.h index dfc6d25..f899548 100644 --- a/include/blt/gp/stack.h +++ b/include/blt/gp/stack.h @@ -54,7 +54,10 @@ namespace blt::gp if (head->used_bytes_in_block() < static_cast(aligned_size())) throw std::runtime_error((std::string("Mismatched Types! Not enough space left in block! Bytes: ") += std::to_string( head->used_bytes_in_block()) += " Size: " + std::to_string(sizeof(T))).c_str()); + // make copy T t = *reinterpret_cast(head->metadata.offset - TYPE_SIZE); + // call destructor + reinterpret_cast(head->metadata.offset - TYPE_SIZE)->~T(); head->metadata.offset -= TYPE_SIZE; if (head->used_bytes_in_block() == 0) {