We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e048e0 commit 12c8fb8Copy full SHA for 12c8fb8
src/tools/miri/src/shims/native_lib.rs
@@ -117,7 +117,12 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
117
let mut info = std::mem::MaybeUninit::<libc::Dl_info>::uninit();
118
unsafe {
119
if libc::dladdr(*func.deref() as *const _, info.as_mut_ptr()) != 0 {
120
- if std::ffi::CStr::from_ptr(info.assume_init().dli_fname).to_str().unwrap()
+ let info = info.assume_init();
121
+ #[cfg(target_os = "cygwin")]
122
+ let fname_ptr = info.dli_fname.as_ptr();
123
+ #[cfg(not(target_os = "cygwin"))]
124
+ let fname_ptr = info.dli_fname;
125
+ if std::ffi::CStr::from_ptr(fname_ptr).to_str().unwrap()
126
!= _lib_path.to_str().unwrap()
127
{
128
return None;
0 commit comments