about summary refs log tree commit diff
path: root/src/libpanic_unwind/seh.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-331/+0
2020-06-03Bump to 1.46Mark Rousskov-4/+1
2020-05-17make abort intrinsic safe, and correct its documentationRalf Jung-1/+4
2020-04-25Bump bootstrap compilerMark Rousskov-1/+0
2020-04-03Make panic unwind the default for aarch64-*-windows-msvc targetsDaniel Frampton-1/+1
2020-03-18fix pre-expansion linting infraMazdak Farrokhzad-1/+0
2020-03-07Apply review feedbackAmanieu d'Antras-1/+1
2020-03-05Simplify the try intrinsic by using a callback in the catch blockAmanieu d'Antras-17/+24
2020-03-02Fix cross-DLL panics under MSVCAmanieu d'Antras-5/+8
2020-03-02Apply review feedbackAmanieu d'Antras-2/+0
2020-03-02Inline catching panics into std::catch_unwindMark Rousskov-3/+1
This allows LLVM to inline the happy path, such that catching unwinding is zero-cost when no panic occurs. This also allows us to match the code generated by C++ try/catch.
2020-01-31Drop cfg(bootstrap) codeMark Rousskov-12/+5
2020-01-11Abort if C++ tries to swallow a Rust panicAmanieu d'Antras-0/+1
2020-01-11Apply review feedbackAmanieu d'Antras-18/+13
2020-01-11Explain the panic! in exception_copyAmanieu d'Antras-0/+8
2020-01-11Fix a memory leak in SEH unwinding if a Rust panic is caught by C++ and ↵Amanieu d'Antras-7/+54
discarded
2019-12-25tidy: change msdn links to newer locationsLzu Tao-1/+1
see accouncement at https://docs.microsoft.com/welcome-to-docs
2019-12-22Format the worldMark Rousskov-23/+23
2019-11-12Remove no longer needed mutabilityMark Rousskov-1/+1
2019-11-12Snap cfgsMark Rousskov-22/+2
2019-11-03Make Emscripten unwinding use a valid type_infoAmanieu d'Antras-2/+3
This allows catch_panic to ignore C++ exceptions.
2019-11-03Make SEH exceptions use a rust_panic type instead of unsigned __int64*Amanieu d'Antras-49/+46
2019-06-17Make use of `ptr::null(_mut)` instead of casting zeroLzu Tao-3/+3
2019-02-13libpanic_unwind => 2018Mazdak Farrokhzad-2/+2
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-2/+2
2018-09-07Fix tidy errorsJordan Rhee-2/+0
2018-09-04Add target thumbv7a-pc-windows-msvcJordan Rhee-1/+3
2018-08-29Replace usages of 'bad_style' with 'nonstandard_style'.Corey Farwell-1/+1
`bad_style` is being deprecated in favor of `nonstandard_style`: - https://github.com/rust-lang/rust/issues/41646
2018-08-19Fix typos found by codespell.Matthias Krüger-2/+2
2018-07-11Deny bare trait objects in in src/libpanic_unwindljedrz-3/+3
2016-09-09Issue deprecation warnings for safe accesses to extern staticsVadim Petrochenkov-2/+2
2016-06-05run rustfmt on libpanic_unwind folderSrinivas Reddy Thatiparthy-6/+3
2016-05-31mk: Prepare for a new stage0 compilerAlex Crichton-9/+1
This commit prepares the source for a new stage0 compiler, the 1.10.0 beta compiler. These artifacts are hot off the bots and should be ready to go.
2016-05-09rustc: Use C++ personalities on MSVCAlex Crichton-74/+253
Currently the compiler has two relatively critical bugs in the implementation of MSVC unwinding: * #33112 - faults like segfaults and illegal instructions will run destructors in Rust, meaning we keep running code after a super-fatal exception has happened. * #33116 - When compiling with LTO plus `-Z no-landing-pads` (or `-C panic=abort` with the previous commit) LLVM won't remove all `invoke` instructions, meaning that some landing pads stick around and cleanups may be run due to the previous bug. These both stem from the flavor of "personality function" that Rust uses for unwinding on MSVC. On 32-bit this is `_except_handler3` and on 64-bit this is `__C_specific_handler`, but they both essentially are the "most generic" personality functions for catching exceptions and running cleanups. That is, thse two personalities will run cleanups for all exceptions unconditionally, so when we use them we run cleanups for **all SEH exceptions** (include things like segfaults). Note that this also explains why LLVM won't optimize away `invoke` instructions. These functions can legitimately still unwind (the `nounwind` attribute only seems to apply to "C++ exception-like unwining"). Also note that the standard library only *catches* Rust exceptions, not others like segfaults and illegal instructions. LLVM has support for another personality, `__CxxFrameHandler3`, which does not run cleanups for general exceptions, only C++ exceptions thrown by `_CxxThrowException`. This essentially ideally matches our use case, so this commit moves us over to using this well-known personality function as well as exception-throwing function. This doesn't *seem* to pull in any extra runtime dependencies just yet, but if it does we can perhaps try to work out how to implement more of it in Rust rather than relying on MSVCRT runtime bits. More details about how this is actually implemented can be found in the changes itself, but this... Closes #33112 Closes #33116
2016-05-09rustc: Implement custom panic runtimesAlex Crichton-0/+147
This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account).