File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -4188,8 +4188,11 @@ void Fortran::lower::attachDeclarePostDeallocAction(
4188
4188
std::stringstream fctName;
4189
4189
fctName << converter.mangleName (sym) << declarePostDeallocSuffix.str ();
4190
4190
mlir::Operation *op = &builder.getInsertionBlock ()->back ();
4191
- if (mlir::isa<fir::ResultOp>(*op))
4191
+ if (auto resOp = mlir::dyn_cast<fir::ResultOp>(*op)) {
4192
+ assert (resOp.getOperands ().size () == 0 &&
4193
+ " expect only fir.result op with no operand" );
4192
4194
op = op->getPrevNode ();
4195
+ }
4193
4196
assert (op && " expect operation to attach the post deallocation action" );
4194
4197
if (op->hasAttr (mlir::acc::getDeclareActionAttrName ())) {
4195
4198
auto attr = op->getAttrOfType <mlir::acc::DeclareActionAttr>(
You can’t perform that action at this time.
0 commit comments