[llvm] [llvm] Fix behavior of llvm.objectsize in presence of negative / large offset (PR #115504)

Harald van Dijk via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 14:50:08 PST 2024


================
@@ -223,6 +223,10 @@ struct SizeOffsetAPInt : public SizeOffsetType<APInt, SizeOffsetAPInt> {
 
 /// OffsetSpan - Used internally by \p ObjectSizeOffsetVisitor. Represents a
 /// point in memory as a pair of allocated bytes before and after it.
+///
+/// \c Before and \c After fields are signed values. It makes it possible to
+/// represent out-of-bound access, e.g. as a result of a GEP, at the expense of
+/// not being able to represent very large allocation.
----------------
hvdijk wrote:

```suggestion
/// not being able to represent very large allocations.
```

https://github.com/llvm/llvm-project/pull/115504


More information about the llvm-commits mailing list