[llvm] [RISCV] Fix crash in combinePExtTruncate for truncate(srl) without MUL/SUB (PR #186141)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 08:46:53 PDT 2026


================
@@ -16965,6 +16965,10 @@ static SDValue combinePExtTruncate(SDNode *N, SelectionDAG &DAG,
     }
   }
 
+  // Ensure Op is a binary operation before accessing its operands.
+  if (Op.getNumOperands() < 2)
----------------
topperc wrote:

`!= 2`?

https://github.com/llvm/llvm-project/pull/186141


More information about the llvm-commits mailing list