Skip to content

Commit fafefd0

Browse files
committed
Fix panicking ui_tests framework
1 parent c74be15 commit fafefd0

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/shims/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'tcx> EnvVars<'tcx> {
5555
};
5656
if forward {
5757
let var_ptr = match target_os {
58-
"linux" | "macos" =>
58+
"linux" | "macos" | "freebsd" =>
5959
alloc_env_var_as_c_str(name.as_ref(), value.as_ref(), ecx)?,
6060
"windows" => alloc_env_var_as_wide_str(name.as_ref(), value.as_ref(), ecx)?,
6161
unsupported =>

src/shims/unix/freebsd/dlsym.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
3232
assert!(this.tcx.sess.target.os == "freebsd");
3333

3434
match dlsym {
35-
_ => {}
35+
_ => {
36+
this.write_null(dest)?;
37+
}
3638
}
3739

3840
trace!("{:?}", this.dump_place(**dest));

src/shims/unix/freebsd/foreign_items.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
1717
_ret: mir::BasicBlock,
1818
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
1919
let this = self.eval_context_mut();
20-
// match
20+
match link_name.as_str() {
21+
_ => {
22+
this.write_null(dest)?;
23+
}
24+
}
2125
Ok(EmulateByNameResult::NeedsJumping)
2226
}
2327
}

0 commit comments

Comments
 (0)