From 855689d699998ed9cec18109308a0524d7a91121 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Tue, 3 Nov 2026 14:58:05 +0100 Subject: [PATCH] LLVMRustWriteOutputFile: Check the result of runCodeGenPipeline Otherwise the llvm::Error object's destrcutor asserts. --- compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index f891ef556db4c..e6cb3c991e491 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -506,6 +506,8 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, LLVMModuleRef M, Error CodeGenError = runCodeGenPipeline(*unwrap(Target), *unwrap(M), BOS, BDwoOS.get(), FileType, !VerifyIR, DisableSimplifyLibCalls); + if (CodeGenError) + return LLVMRustResult::Failure; #else std::unique_ptr PM = std::make_unique();