[Mlir-commits] [mlir] [mlir] Fix possible null dereference during error logging in EmitC (PR #157456)
    Mehdi Amini 
    llvmlistbot at llvm.org
       
    Wed Sep 10 11:49:00 PDT 2025
    
    
  
================
@@ -1320,7 +1320,11 @@ GetGlobalOp::verifySymbolUses(SymbolTableCollection &symbolTable) {
 
   // global has non-array type
   auto lvalueType = dyn_cast<LValueType>(resultType);
-  if (!lvalueType || lvalueType.getValueType() != globalType)
+  if (!lvalueType)
+    return emitOpError("on non-array type expects result type to be an "
+                       "lvalue type for the global @")
+           << getName();
----------------
joker-eph wrote:
Can we get this covered by a test plus?
https://github.com/llvm/llvm-project/pull/157456
    
    
More information about the Mlir-commits
mailing list