about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-04-26 17:09:08 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-04-26 17:09:08 -0700
commit20ad427af014aa6f8734629baa922c52f1ee8b77 (patch)
tree477a942f3fef391bb289451b365b2e79d205a76f
parent949010d23e9f7037a8e6f323588873b3d2438fb1 (diff)
downloadrust-20ad427af014aa6f8734629baa922c52f1ee8b77.tar.gz
rust-20ad427af014aa6f8734629baa922c52f1ee8b77.zip
rustc: Emit `uwtable` for allocator shims
This commit emits the `uwtable` attribute to LLVM for platforms that require it
for the allocator shims that we generate to ensure that they can hopefully get
unwound past. This is a stab in the dark at helping
https://bugzilla.mozilla.org/show_bug.cgi?id=1456150 along.
-rw-r--r--src/librustc_trans/allocator.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_trans/allocator.rs b/src/librustc_trans/allocator.rs
index ffebb959ebf..871fe98ec01 100644
--- a/src/librustc_trans/allocator.rs
+++ b/src/librustc_trans/allocator.rs
@@ -11,6 +11,7 @@
 use std::ffi::CString;
 use std::ptr;
 
+use attributes;
 use libc::c_uint;
 use rustc::middle::allocator::AllocatorKind;
 use rustc::ty::TyCtxt;
@@ -67,6 +68,9 @@ pub(crate) unsafe fn trans(tcx: TyCtxt, mods: &ModuleLlvm, kind: AllocatorKind)
         if tcx.sess.target.target.options.default_hidden_visibility {
             llvm::LLVMRustSetVisibility(llfn, llvm::Visibility::Hidden);
         }
+       if tcx.sess.target.target.options.requires_uwtable {
+           attributes::emit_uwtable(llfn, true);
+       }
 
         let callee = CString::new(kind.fn_name(method.name)).unwrap();
         let callee = llvm::LLVMRustGetOrInsertFunction(llmod,