aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-05-08 12:36:58 +0200
committerGitHub Enterprise <[email protected]>2024-05-08 12:36:58 +0200
commite3e1a95d1e754a48f8d348beaed65d5266082659 (patch)
treea41701d3ee04e13fc05ef1f03f01c7f9b759c1ed /src
parentcheck partial chunk result (#73) (diff)
downloadzen-e3e1a95d1e754a48f8d348beaed65d5266082659.tar.xz
zen-e3e1a95d1e754a48f8d348beaed65d5266082659.zip
Correctly calculate memory view size from Mid/MidInline function if size is not given (#76)
Diffstat (limited to 'src')
-rw-r--r--src/zencore/include/zencore/memory.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/zencore/include/zencore/memory.h b/src/zencore/include/zencore/memory.h
index a1f48555e..6965b76b1 100644
--- a/src/zencore/include/zencore/memory.h
+++ b/src/zencore/include/zencore/memory.h
@@ -141,7 +141,10 @@ struct MutableMemoryView
inline void MidInline(uint64_t InOffset, uint64_t InSize = ~uint64_t(0))
{
RightChopInline(InOffset);
- LeftInline(InSize);
+ if (InSize != ~uint64_t(0))
+ {
+ LeftInline(InSize);
+ }
}
/** Returns the middle part of the view by taking up to the given number of bytes from the given position. */
@@ -271,7 +274,10 @@ struct MemoryView
inline void MidInline(uint64_t InOffset, uint64_t InSize = ~uint64_t(0))
{
RightChopInline(InOffset);
- LeftInline(InSize);
+ if (InSize != ~uint64_t(0))
+ {
+ LeftInline(InSize);
+ }
}
/** Returns the middle part of the view by taking up to the given number of bytes from the given position. */