[Mlir-commits] [mlir] Fix a nullptr dereferencing in a `FuncBufferizableOpInterfaceImpl.cpp::getCalledFunction` (PR #150518)

Matthias Springer llvmlistbot at llvm.org
Fri Jul 25 04:24:42 PDT 2025


================
@@ -90,8 +90,9 @@ static FuncOp getCalledFunction(CallOpInterface callOp,
                                 const AnalysisState &state) {
   auto &oneShotAnalysisState = static_cast<const OneShotAnalysisState &>(state);
 
-  if (auto *funcAnalysisState =
-          oneShotAnalysisState.getExtension<FuncAnalysisState>()) {
+  auto *funcAnalysisState =
----------------
matthias-springer wrote:

Does this really fix the issue?
```
auto *x = abc();
if (x != nullptr) foo();
```
is identical to
```
if (auto *x = abc()) foo();
```


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


More information about the Mlir-commits mailing list