aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-05-17 01:52:02 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-05-17 23:50:38 -0700
commitb6798c26efc4689cf35c5f4ac0436b4510a1f813 (patch)
tree9507321f623264de9c5bef41ff53c19c88f09bd3 /lib
parent95f5e17e49d32a301d6a9d6f9948719d65469b09 (diff)
downloadzig-b6798c26efc4689cf35c5f4ac0436b4510a1f813.tar.gz
zig-b6798c26efc4689cf35c5f4ac0436b4510a1f813.zip
stage2: fix pointer arithmetic result type
This makes it so the result of doing pointer arithmetic creates a new pointer type that has adjusted alignment.
Diffstat (limited to 'lib')
-rw-r--r--lib/std/heap.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/heap.zig b/lib/std/heap.zig
index 65952f6c50..cbbe111a26 100644
--- a/lib/std/heap.zig
+++ b/lib/std/heap.zig
@@ -345,7 +345,7 @@ const PageAllocator = struct {
// Unmap extra pages
const aligned_buffer_len = alloc_len - drop_len;
if (aligned_buffer_len > aligned_len) {
- os.munmap(result_ptr[aligned_len..aligned_buffer_len]);
+ os.munmap(@alignCast(mem.page_size, result_ptr[aligned_len..aligned_buffer_len]));
}
const new_hint = @alignCast(mem.page_size, result_ptr + aligned_len);