Skip to content

Commit 3907a13

Browse files
committed
auto merge of #17425 : klutzy/rust/win-backtrace, r=alexcrichton
Fixes #17372
2 parents 8a45818 + 3bc7d3d commit 3907a13

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libstd/rt/backtrace.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ mod imp {
701701
static IMAGE_FILE_MACHINE_IA64: libc::DWORD = 0x0200;
702702
static IMAGE_FILE_MACHINE_AMD64: libc::DWORD = 0x8664;
703703

704-
#[repr(C, packed)]
704+
#[repr(C)]
705705
struct SYMBOL_INFO {
706706
SizeOfStruct: libc::c_ulong,
707707
TypeIndex: libc::c_ulong,
@@ -983,8 +983,10 @@ mod imp {
983983
try!(write!(w, " {:2}: {:#2$x}", i, addr, super::HEX_WIDTH));
984984
let mut info: SYMBOL_INFO = unsafe { intrinsics::init() };
985985
info.MaxNameLen = MAX_SYM_NAME as libc::c_ulong;
986-
info.SizeOfStruct = (mem::size_of::<SYMBOL_INFO>() -
987-
info.Name.len() + 1) as libc::c_ulong;
986+
// the struct size in C. the value is different to
987+
// `size_of::<SYMBOL_INFO>() - MAX_SYM_NAME + 1` (== 81)
988+
// due to struct alignment.
989+
info.SizeOfStruct = 88;
988990

989991
let mut displacement = 0u64;
990992
let ret = SymFromAddr(process, addr as u64, &mut displacement,

0 commit comments

Comments
 (0)