From c665215d69d2eec0a89bf51e26c4f5466bb5d7de Mon Sep 17 00:00:00 2001 From: Nav Date: Fri, 24 Dec 2021 14:35:11 +0000 Subject: [PATCH] Corrected size() function in TargetMemoryDescriptor scruct. This was hiding the issue with incorrect end addresses in AVR8 memory descriptors --- src/Targets/TargetMemory.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Targets/TargetMemory.hpp b/src/Targets/TargetMemory.hpp index aa5a5084..a7556375 100644 --- a/src/Targets/TargetMemory.hpp +++ b/src/Targets/TargetMemory.hpp @@ -38,8 +38,8 @@ namespace Bloom::Targets TargetMemoryDescriptor(TargetMemoryType type, TargetMemoryAddressRange addressRange) : type(type), addressRange(addressRange) {}; - std::uint32_t size() const { - return this->addressRange.endAddress - this->addressRange.startAddress; + [[nodiscard]] std::uint32_t size() const { + return (this->addressRange.endAddress - this->addressRange.startAddress) + 1; } };