Skip to content

Commit 457c6f5

Browse files
authored
Merge pull request #27128 from jckarter/reflection-context-alignment-5.1
[5.1] ReflectionContext: Keep read range properly aligned.
2 parents 7a8eaa9 + 36e0fd3 commit 457c6f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/swift/Reflection/ReflectionContext.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ class ReflectionContext
193193
}
194194
RangeStart = std::min(RangeStart, (uint64_t)S->addr + Slide);
195195
RangeEnd = std::max(RangeEnd, (uint64_t)(S->addr + S->size + Slide));
196+
// Keep the range rounded to 8 byte alignment on both ends so we don't
197+
// introduce misaligned pointers mapping between local and remote
198+
// address space.
199+
RangeStart = RangeStart & ~7;
200+
RangeEnd = RangeEnd + 7 & ~7;
196201
}
197202

198203
if (RangeStart == UINT64_MAX && RangeEnd == UINT64_MAX)

0 commit comments

Comments
 (0)