about summary refs log tree commit diff
path: root/library/std/src/sys/windows/alloc.rs
diff options
context:
space:
mode:
authorAria Beingessner <a.beingessner@gmail.com>2022-03-22 01:24:55 -0400
committerAria Beingessner <a.beingessner@gmail.com>2022-03-29 20:18:21 -0400
commitc7de289e1c8d24bd55aaa33813e509920a00c364 (patch)
treeb8dcd314558cc77fe1353c890c39c7026b7414b8 /library/std/src/sys/windows/alloc.rs
parent5167b6891ccf05aa7a2191675e6c3da95d84374a (diff)
downloadrust-c7de289e1c8d24bd55aaa33813e509920a00c364.tar.gz
rust-c7de289e1c8d24bd55aaa33813e509920a00c364.zip
Make the stdlib largely conform to strict provenance.
Some things like the unwinders and system APIs are not fully conformant,
this only covers a lot of low-hanging fruit.
Diffstat (limited to 'library/std/src/sys/windows/alloc.rs')
-rw-r--r--library/std/src/sys/windows/alloc.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/windows/alloc.rs b/library/std/src/sys/windows/alloc.rs
index 2fe71f9f28d..fdc81cdea7d 100644
--- a/library/std/src/sys/windows/alloc.rs
+++ b/library/std/src/sys/windows/alloc.rs
@@ -159,7 +159,7 @@ unsafe fn allocate(layout: Layout, zeroed: bool) -> *mut u8 {
         // Create a correctly aligned pointer offset from the start of the allocated block,
         // and write a header before it.
 
-        let offset = layout.align() - (ptr as usize & (layout.align() - 1));
+        let offset = layout.align() - (ptr.addr() & (layout.align() - 1));
         // SAFETY: `MIN_ALIGN` <= `offset` <= `layout.align()` and the size of the allocated
         // block is `layout.align() + layout.size()`. `aligned` will thus be a correctly aligned
         // pointer inside the allocated block with at least `layout.size()` bytes after it and at