[Mlir-commits] [mlir] [mlir] Check variable for null before dereferencing in Dialect/SPIRV/IR (PR #157457)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Sep 8 06:27:58 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-spirv

Author: Daniel Kuts (apach301)

<details>
<summary>Changes</summary>

FIxes #<!-- -->157453 

---
Full diff: https://github.com/llvm/llvm-project/pull/157457.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp (+2-2) 


``````````diff
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
index f99339852824c..7a6d4a212159b 100644
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
@@ -727,9 +727,9 @@ void mlir::spirv::ConstantOp::getAsmResultNames(
       return setNameFn(getResult(), (intCst.getInt() ? "true" : "false"));
     }
 
-    if (intTy.isSignless()) {
+    if (intTy && intTy.isSignless()) {
       specialName << intCst.getInt();
-    } else if (intTy.isUnsigned()) {
+    } else if (intTy && intTy.isUnsigned()) {
       specialName << intCst.getUInt();
     } else {
       specialName << intCst.getSInt();

``````````

</details>


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


More information about the Mlir-commits mailing list