diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 72ff9ea118e28..5381f6fe095b6 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -1029,6 +1029,12 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { } fn set_personality_fn(&mut self, personality: &'ll Value) { + // Work around for https://github.com/rust-lang/rust/issues/123733 + // add the UWTable attribute to every function with a personality function. + let uwtable = + attributes::uwtable_attr(self.llcx, None); + attributes::apply_to_llfn(self.llfn(), llvm::AttributePlace::Function, &[uwtable]); + unsafe { llvm::LLVMSetPersonalityFn(self.llfn(), personality); }