From 0f1840a70d11a3d317afa55b8361829b93c8eeb8 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Wed, 10 Jan 2024 08:51:03 +0000 Subject: [PATCH 1/2] Update LICENSE --- LICENSE | 2 -- 1 file changed, 2 deletions(-) diff --git a/LICENSE b/LICENSE index 0e19085c8..d13cc4b26 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,5 @@ The MIT License (MIT) -Copyright (c) 2016 jwellbelove, https://github.com/ETLCPP/etl, http://www.etlcpp.com - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights From 84031659fa8ac16a3942494f8b4263b1a8bf1aa9 Mon Sep 17 00:00:00 2001 From: Chiraffollo <5937599+Chiraffollo@users.noreply.github.com> Date: Sat, 27 Jan 2024 01:55:51 +0100 Subject: [PATCH 2/2] Fix #832: Only copy/move storage value when optional is valid (#833) --- include/etl/optional.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/etl/optional.h b/include/etl/optional.h index d85763d25..6431efb58 100644 --- a/include/etl/optional.h +++ b/include/etl/optional.h @@ -768,7 +768,10 @@ namespace etl { if (this != &other) { - storage.value = other.storage.value; + if (other.valid) + { + storage.value = other.storage.value; + } valid = other.valid; } @@ -783,7 +786,10 @@ namespace etl { if (this != &other) { - storage.value = etl::move(other.storage.value); + if (other.valid) + { + storage.value = etl::move(other.storage.value); + } valid = other.valid; }