diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-07-01 19:09:25 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-07-02 10:19:59 +0000 |
| commit | e03c3b6f19df854fbc52dc57bf39dbe9ae4972e9 (patch) | |
| tree | 419975590eac792aae5acf54f9a49d596719da31 | |
| parent | 45b0f68e34c37e5e5f47a1474ad87ebdb099af4b (diff) | |
| download | rust-e03c3b6f19df854fbc52dc57bf39dbe9ae4972e9.tar.gz rust-e03c3b6f19df854fbc52dc57bf39dbe9ae4972e9.zip | |
Allow _Unwind_RaiseException with MinGW
| -rw-r--r-- | src/tools/miri/src/shims/windows/foreign_items.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/miri/src/shims/windows/foreign_items.rs b/src/tools/miri/src/shims/windows/foreign_items.rs index c9db798caad..71f6a2bc033 100644 --- a/src/tools/miri/src/shims/windows/foreign_items.rs +++ b/src/tools/miri/src/shims/windows/foreign_items.rs @@ -758,6 +758,22 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { this.write_null(dest)?; } + "_Unwind_RaiseException" => { + // This is not formally part of POSIX, but it is very wide-spread on POSIX systems. + // It was originally specified as part of the Itanium C++ ABI: + // https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html#base-throw. + // MinGW implements _Unwind_RaiseException on top of SEH exceptions. + if this.tcx.sess.target.env != "gnu" { + throw_unsup_format!( + "`_Unwind_RaiseException` is not supported on non-MinGW Windows", + ); + } + // This function looks and behaves excatly like miri_start_unwind. + let [payload] = this.check_shim(abi, Abi::C { unwind: true }, link_name, args)?; + this.handle_miri_start_unwind(payload)?; + return Ok(EmulateItemResult::NeedsUnwind); + } + _ => return Ok(EmulateItemResult::NotSupported), } |
