@@ -3234,12 +3234,14 @@ class ArrayExprLowering {
3234
3234
determineShapeOfDest (lhs);
3235
3235
semant = ConstituentSemantics::RefTransparent;
3236
3236
auto exv = lowerArrayExpression (rhs);
3237
- if (explicitSpaceIsActive ())
3237
+ if (explicitSpaceIsActive ()) {
3238
+ explicitSpace->finalizeContext ();
3238
3239
builder.create <fir::ResultOp>(loc, fir::getBase (exv));
3239
- else
3240
+ } else {
3240
3241
builder.create <fir::ArrayMergeStoreOp>(
3241
3242
loc, destination, fir::getBase (exv), destination.memref (),
3242
3243
destination.slice (), destination.typeparams ());
3244
+ }
3243
3245
}
3244
3246
3245
3247
// ===--------------------------------------------------------------------===//
@@ -3344,12 +3346,14 @@ class ArrayExprLowering {
3344
3346
// Finish lowering the loop nest.
3345
3347
assert (destination && " destination must have been set" );
3346
3348
auto exv = lowerArrayExpression (rhsCC, resultTy);
3347
- if (explicitSpaceIsActive ())
3349
+ if (explicitSpaceIsActive ()) {
3350
+ explicitSpace->finalizeContext ();
3348
3351
builder.create <fir::ResultOp>(loc, fir::getBase (exv));
3349
- else
3352
+ } else {
3350
3353
builder.create <fir::ArrayMergeStoreOp>(
3351
3354
loc, destination, fir::getBase (exv), destination.memref (),
3352
3355
destination.slice (), destination.typeparams ());
3356
+ }
3353
3357
}
3354
3358
3355
3359
// / Entry point for when an array expression appears on the lhs of an
@@ -3729,12 +3733,14 @@ class ArrayExprLowering {
3729
3733
determineShapeOfDest (lhs);
3730
3734
semant = ConstituentSemantics::RefTransparent;
3731
3735
auto exv = lowerArrayExpression (rhs);
3732
- if (explicitSpaceIsActive ())
3736
+ if (explicitSpaceIsActive ()) {
3737
+ explicitSpace->finalizeContext ();
3733
3738
builder.create <fir::ResultOp>(loc, fir::getBase (exv));
3734
- else
3739
+ } else {
3735
3740
builder.create <fir::ArrayMergeStoreOp>(
3736
3741
loc, destination, fir::getBase (exv), destination.memref (),
3737
3742
destination.slice (), destination.typeparams ());
3743
+ }
3738
3744
}
3739
3745
3740
3746
// / Compute the shape of a slice.
0 commit comments