Skip to content

Commit a109d6d

Browse files
committed
Fix block args
1 parent c5f2351 commit a109d6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/lib/Optimizer/Builder/IntrinsicCall.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3262,7 +3262,8 @@ void IntrinsicLibrary::genCFPointer(llvm::ArrayRef<fir::ExtendedValue> args) {
32623262
// to be synced.
32633263
if (auto declare = mlir::dyn_cast_or_null<hlfir::DeclareOp>(
32643264
fPtr->getAddr().getDefiningOp()))
3265-
if (mlir::isa<fir::AddrOfOp>(declare.getMemref().getDefiningOp()))
3265+
if (declare.getMemref().getDefiningOp() &&
3266+
mlir::isa<fir::AddrOfOp>(declare.getMemref().getDefiningOp()))
32663267
if (cuf::isRegisteredDeviceAttr(declare.getDataAttr()) &&
32673268
!cuf::isCUDADeviceContext(builder.getRegion()))
32683269
fir::runtime::cuda::genSyncGlobalDescriptor(builder, loc,

0 commit comments

Comments
 (0)