[llvm] 8c42b5e - [SelectionDAG] Add missing semicolon after return.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 10:24:36 PDT 2022


Author: Craig Topper
Date: 2022-10-25T10:24:01-07:00
New Revision: 8c42b5e89e1948e3a2ccfa3f09d4360f5eb47833

URL: https://github.com/llvm/llvm-project/commit/8c42b5e89e1948e3a2ccfa3f09d4360f5eb47833
DIFF: https://github.com/llvm/llvm-project/commit/8c42b5e89e1948e3a2ccfa3f09d4360f5eb47833.diff

LOG: [SelectionDAG] Add missing semicolon after return.

I'm unsure what the code does without the semicolon. On the surface it
seems like the assert below it would be considered part of the if
and thus the assert would only execute if DestReg is 0. But 0 isn't
considered a virtual register so the assert should fail.

Found by PVS Studio.
Reported https://pvs-studio.com/en/blog/posts/cpp/1003/ (N7)

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 48cb7682c25b..b1e369d21887 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -451,7 +451,7 @@ void FunctionLoweringInfo::ComputePHILiveOutRegInfo(const PHINode *PN) {
 
   Register DestReg = It->second;
   if (DestReg == 0)
-    return
+    return;
   assert(Register::isVirtualRegister(DestReg) && "Expected a virtual reg");
   LiveOutRegInfo.grow(DestReg);
   LiveOutInfo &DestLOI = LiveOutRegInfo[DestReg];


        


More information about the llvm-commits mailing list