@@ -622,6 +622,25 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, '
622
622
self . write_ptr ( dest, addr, dest_ty) ?;
623
623
}
624
624
625
+ // Windows ABI
626
+ "AddVectoredExceptionHandler" => {
627
+ // any non zero value works for the stdlib. This is just used for stackoverflows anyway
628
+ self . write_scalar ( dest, Scalar :: from_u128 ( 1 ) , dest_ty) ?;
629
+ } ,
630
+ "GetModuleHandleW" |
631
+ "GetProcAddress" |
632
+ "InitializeCriticalSection" |
633
+ "EnterCriticalSection" |
634
+ "LeaveCriticalSection" |
635
+ "SetLastError" => {
636
+ // pretend these do not exist/nothing happened, by returning zero
637
+ self . write_scalar ( dest, Scalar :: from_u128 ( 0 ) , dest_ty) ?;
638
+ } ,
639
+ "GetLastError" => {
640
+ // this is c::ERROR_CALL_NOT_IMPLEMENTED
641
+ self . write_scalar ( dest, Scalar :: from_u128 ( 120 ) , dest_ty) ?;
642
+ } ,
643
+
625
644
_ => {
626
645
return err ! ( Unimplemented (
627
646
format!( "can't call C ABI function: {}" , link_name) ,
@@ -728,6 +747,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, '
728
747
let bool = self . tcx . types . bool ;
729
748
self . write_scalar ( dest, Scalar :: from_bool ( false ) , bool) ?;
730
749
}
750
+
731
751
_ => return err ! ( NoMirFor ( path) ) ,
732
752
}
733
753
0 commit comments