]> git.lizzy.rs Git - rust.git/commit
std: Avoid panics in rust_eh_personality
authorAlex Crichton <alex@alexcrichton.com>
Tue, 6 Jun 2017 18:34:10 +0000 (11:34 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 8 Jun 2017 14:06:43 +0000 (07:06 -0700)
commit52805d233b59503cdfe58ee21e894ed6bb3b1da9
tree36df6e39ebdde78dc3001625f5d6a612d30e0fe1
parentae7920153331f26f2bc144f62082e95e74c2ba31
std: Avoid panics in rust_eh_personality

This commit removes a few calls to panic and/or assert in `rust_eh_personality`.
This function definitely can't itself panic (that'd probably segfault or do
something else weird) and I was also noticing that a `pub extern fn foo() {}`
cdylib was abnormally large. Turns out all that size was the panicking machinery
brought in by the personality function!

The change here is to return a `Result` internally so we can bubble up the fatal
error, eventually translating to the appropriate error code for the libunwind
ABI.
src/libpanic_unwind/dwarf/eh.rs
src/libpanic_unwind/gcc.rs
src/libpanic_unwind/seh64_gnu.rs