From 870f6917936fdb8050be3ca3c67d9259390c4326 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 10 Jan 2020 11:00:06 +0000 Subject: [PATCH] Fix "pointer is null" static analyzer warnings. NFCI. Assert that the pointers are non-null before dereferencing them. --- llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp b/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp index b18730d..d0285a7 100644 --- a/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp +++ b/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp @@ -282,6 +282,7 @@ bool HexagonEarlyIfConversion::matchFlowPattern(MachineBasicBlock *B, // can fall through into the other, in other words, it will be executed // in both cases. We only want to predicate the block that is executed // conditionally. + assert(TB && FB && "Failed to find triangle control flow blocks"); unsigned TNP = TB->pred_size(), FNP = FB->pred_size(); unsigned TNS = TB->succ_size(), FNS = FB->succ_size(); -- 2.7.4