summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/DataEncoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/DataEncoder.cpp')
-rw-r--r--lldb/source/Core/DataEncoder.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/lldb/source/Core/DataEncoder.cpp b/lldb/source/Core/DataEncoder.cpp
index 933cc3eb23b..92a9104acc3 100644
--- a/lldb/source/Core/DataEncoder.cpp
+++ b/lldb/source/Core/DataEncoder.cpp
@@ -142,32 +142,6 @@ DataEncoder::GetSharedDataOffset () const
return 0;
}
-//------------------------------------------------------------------
-// Returns true if there are LENGTH bytes availabe starting OFFSET
-// into the data that is in this object.
-//------------------------------------------------------------------
-bool
-DataEncoder::ValidOffsetForDataOfSize (uint32_t offset, uint32_t length) const
-{
- size_t size = GetByteSize();
- if (offset >= size)
- return false; // offset isn't valid
-
- if (length == 0)
- return true; // No bytes requested at this offset, return true
-
- // If we flip the bits in offset we can figure out how
- // many bytes we have left before "offset + length"
- // could overflow when doing unsigned arithmetic.
- if (length > ~offset)
- return false; // unsigned overflow
-
- // Make sure "offset + length" is a valid offset as well.
- // length must be greater than zero for this to be a
- // valid expression, and we have already checked for this.
- return ((offset + length) <= size);
-}
-
//----------------------------------------------------------------------
// Set the data with which this object will extract from to data
// starting at BYTES and set the length of the data to LENGTH bytes
OpenPOWER on IntegriCloud