[llvm] [TableGen] Fix potential null pointer dereference in parseInstruction (PR #180767)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 08:15:53 PST 2026


https://github.com/JaydeepChauhan14 created https://github.com/llvm/llvm-project/pull/180767

None

>From ef8748019d27e759d1925b28d53654572a6d61ad Mon Sep 17 00:00:00 2001
From: Chauhan Jaydeep Ashwinbhai <chauhan.jaydeep.ashwinbhai at intel.com>
Date: Tue, 10 Feb 2026 08:15:03 -0800
Subject: [PATCH] [TableGen] Fix potential null pointer dereference in
 parseInstructionPattern

---
 llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
index 5827497488943..6874f45fbf78b 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
@@ -4014,6 +4014,8 @@ void CodeGenDAGPatterns::parseInstructionPattern(const CodeGenInstruction &CGI,
               " should be a set destination: all "
               "outputs must occur before inputs in operand list!");
 
+    assert(R && "Record should not be null");
+
     if (!checkOperandClass(CGI.Operands[i], R))
       I.error("Operand $" + OpName + " class mismatch!");
 



More information about the llvm-commits mailing list