about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-24 08:42:33 +0100
committerGitHub <noreply@github.com>2022-11-24 08:42:33 +0100
commit1e0df8827b575c2910fae7edd1f920723cb3ee81 (patch)
treeabf89606404f64af824d7718fac67990cd22112b
parent5197ef66b72180f39ed1e6cbf246350246a557ad (diff)
parent693c6311f06bf49ff0fd7b972d769634e4b330b1 (diff)
downloadrust-1e0df8827b575c2910fae7edd1f920723cb3ee81.tar.gz
rust-1e0df8827b575c2910fae7edd1f920723cb3ee81.zip
Rollup merge of #104517 - dfordivam:patch-1, r=cuviper
Throw error on failure in loading llvm-plugin

The following code silently ignores the error as the `LLVMRustSetLastError` only tracks one error at a time. At all other places where `LLVMRustSetLastError` is used the code immediately returns.

https://github.com/rust-lang/rust/blob/251831ece9601d64172127b6caae9087358c2386/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L801-L804
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index 18d37d95a83..5f02bb6c307 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -800,7 +800,7 @@ LLVMRustOptimize(
       auto Plugin = PassPlugin::Load(PluginPath.str());
       if (!Plugin) {
         LLVMRustSetLastError(("Failed to load pass plugin" + PluginPath.str()).c_str());
-        continue;
+        return LLVMRustResult::Failure;
       }
       Plugin->registerPassBuilderCallbacks(PB);
     }