<div dir="ltr">If this is meant to be NFC, I guess the function is never meant to return null? (it's meant to be an invariant of the code that at least one of the builders is valid) - if that's the case, I'm not sure if this is good change.<br><br>If there is a bug in the future that causes there to be an no valid builder - this change will cause that failure mode to be delayed and more distant from the problem, compared to the failure that this code would have under msan if it attempted to return garbage, I think? (hmm, well, I guess not /much/ better, even the msan failure is delayed until the value is used in an "interesting" way - not directly on the return - but the msan error is clearer/might lead someone back to the variable declaration (where we could have a comment about the intended invariant of the code) compared to them thinking null was a valid return value from the function and adding null handling in the caller instead)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 17, 2021 at 6:09 AM Simon Pilgrim via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Simon Pilgrim<br>
Date: 2021-05-17T14:08:27+01:00<br>
New Revision: b89e09a19f9b60dfa9477b24a404a7ae5522f898<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/b89e09a19f9b60dfa9477b24a404a7ae5522f898" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/b89e09a19f9b60dfa9477b24a404a7ae5522f898</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/b89e09a19f9b60dfa9477b24a404a7ae5522f898.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/b89e09a19f9b60dfa9477b24a404a7ae5522f898.diff</a><br>
<br>
LOG: Silence "Undefined or garbage value returned to caller" static analysis warning. NFCI.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    clang/lib/Driver/Driver.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp<br>
index 1086887a8de5..25af909d9bd2 100644<br>
--- a/clang/lib/Driver/Driver.cpp<br>
+++ b/clang/lib/Driver/Driver.cpp<br>
@@ -3449,7 +3449,7 @@ class OffloadingActionBuilder final {<br>
       return nullptr;<br>
<br>
     // Let builders add host linking actions.<br>
-    Action* HA;<br>
+    Action* HA = nullptr;<br>
     for (DeviceActionBuilder *SB : SpecializedBuilders) {<br>
       if (!SB->isValid())<br>
         continue;<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>