[llvm] Add missing return on nullptr check (PR #92125)
Daniel Kuts via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 07:06:55 PDT 2024
https://github.com/apach301 created https://github.com/llvm/llvm-project/pull/92125
Fixes #92123
>From 0c10430e892cb7fee57ddbd0359fc4252d3de400 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