[Mlir-commits] [mlir] [mlir] Fix possible null dereference during error logging in EmitC (PR #157456)
Mehdi Amini
llvmlistbot at llvm.org
Sat Sep 13 12:20: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:
`mlir/test/Dialect/EmitC/invalid_ops.mlir` has a test that emits the error that is modified here, so a variant of this test should be able to trigger this I'd think?
https://github.com/llvm/llvm-project/pull/157456
More information about the Mlir-commits
mailing list