[llvm] Add missing return on nullptr check (PR #92125)
Daniel Kuts via llvm-commits
llvm-commits at lists.llvm.org
Wed May 15 02:06:56 PDT 2024
https://github.com/apach301 updated https://github.com/llvm/llvm-project/pull/92125
>From b22942cab25efa6d308b0494e312b038bea81f7e Mon Sep 17 00:00:00 2001
From: Daniil Kutz <kutz at ispras.ru>
Date: Tue, 14 May 2024 16:58:19 +0300
Subject: [PATCH] Add missing return on nullptr check
---
llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
index 88d353e89a461..92347b7b58a12 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
@@ -3392,8 +3392,10 @@ static bool HandleUse(TreePattern &I, TreePatternNodePtr Pat,
Record *Rec;
if (Pat->isLeaf()) {
DefInit *DI = dyn_cast<DefInit>(Pat->getLeafValue());
- if (!DI)
+ if (!DI) {
I.error("Input $" + Pat->getName() + " must be an identifier!");
+ return false;
+ }
Rec = DI->getDef();
} else {
Rec = Pat->getOperator();
More information about the llvm-commits
mailing list