@@ -5,7 +5,7 @@ use rustc_target::abi::{Align, LayoutOf, Size};
55use rustc_target:: spec:: abi:: Abi ;
66
77use crate :: * ;
8- use helpers:: { check_abi , check_arg_count} ;
8+ use helpers:: check_arg_count;
99use shims:: posix:: fs:: EvalContextExt as _;
1010use shims:: posix:: sync:: EvalContextExt as _;
1111use shims:: posix:: thread:: EvalContextExt as _;
@@ -22,9 +22,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
2222 ) -> InterpResult < ' tcx , bool > {
2323 let this = self . eval_context_mut ( ) ;
2424
25- check_abi ( abi, Abi :: C { unwind : false } ) ?;
26-
27- match link_name {
25+ match_with_abi_check ! ( link_name, abi, Abi :: C { unwind: false } , {
2826 // Environment related shims
2927 "getenv" => {
3028 let & [ ref name] = check_arg_count( args) ?;
@@ -458,12 +456,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
458456 // Platform-specific shims
459457 _ => {
460458 match this. tcx. sess. target. os. as_str( ) {
461- "linux" => return shims:: posix:: linux:: foreign_items:: EvalContextExt :: emulate_foreign_item_by_name ( this, link_name, args, dest, ret) ,
462- "macos" => return shims:: posix:: macos:: foreign_items:: EvalContextExt :: emulate_foreign_item_by_name ( this, link_name, args, dest, ret) ,
459+ "linux" => return shims:: posix:: linux:: foreign_items:: EvalContextExt :: emulate_foreign_item_by_name( this, link_name, abi , args, dest, ret) ,
460+ "macos" => return shims:: posix:: macos:: foreign_items:: EvalContextExt :: emulate_foreign_item_by_name( this, link_name, abi , args, dest, ret) ,
463461 _ => unreachable!( ) ,
464462 }
465463 }
466- } ;
464+ } ) ;
467465
468466 Ok ( true )
469467 }
0 commit comments