Skip to content

Commit f3e305c

Browse files
this is not really unsafe but whatever
1 parent 7d52b2a commit f3e305c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/symbolize/dbghelp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ unsafe fn do_resolve(
245245
// the real value.
246246
// SAFETY: We assume NameLen has been initialized by SymFromAddrW, and we initialized MaxNameLen
247247
let name_len = unsafe { cmp::min((*info).NameLen as usize, (*info).MaxNameLen as usize - 1) };
248-
// Name must be initialized by SymFromAddrW, but we only interact with it as a pointer anyways.
249-
let name_ptr = (&raw const (*info).Name).cast::<u16>();
248+
// SAFETY: Name must be initialized by SymFromAddrW, but we only interact with it as a pointer anyways.
249+
let name_ptr = unsafe { (&raw const (*info).Name).cast::<u16>() };
250250

251251
// Reencode the utf-16 symbol to utf-8 so we can use `SymbolName::new` like
252252
// all other platforms

0 commit comments

Comments
 (0)