@@ -64,10 +64,11 @@ static RT_API_ATTRS common::optional<bool> DefinedFormattedIo(
64
64
: *io.GetNextDataEdit (1 )};
65
65
char ioType[2 + edit.maxIoTypeChars ];
66
66
auto ioTypeLen{std::size_t {2 } /* "DT"*/ + edit.ioTypeChars };
67
+ auto &definedIoArgs{*io.get_if <DefinedIoArgs>()};
67
68
if (edit.descriptor == DataEdit::DefinedDerivedType) {
68
69
ioType[0 ] = ' D' ;
69
70
ioType[1 ] = ' T' ;
70
- runtime::memcpy (ioType + 2 , edit .ioType , edit.ioTypeChars );
71
+ runtime::memcpy (ioType + 2 , definedIoArgs .ioType , edit.ioTypeChars );
71
72
} else {
72
73
runtime::strcpy (
73
74
ioType, io.mutableModes ().inNamelist ? " NAMELIST" : " LISTDIRECTED" );
@@ -81,7 +82,7 @@ static RT_API_ATTRS common::optional<bool> DefinedFormattedIo(
81
82
if (integer8) {
82
83
// Convert v_list values to INTEGER(8)
83
84
for (int j{0 }; j < edit.vListEntries ; ++j) {
84
- vList64[j] = edit .vList [j];
85
+ vList64[j] = definedIoArgs .vList [j];
85
86
}
86
87
vListDesc.Establish (
87
88
TypeCategory::Integer, sizeof (std::int64_t ), nullptr , 1 );
@@ -91,7 +92,7 @@ static RT_API_ATTRS common::optional<bool> DefinedFormattedIo(
91
92
static_cast <SubscriptValue>(sizeof (std::int64_t )));
92
93
} else {
93
94
vListDesc.Establish (TypeCategory::Integer, sizeof (int ), nullptr , 1 );
94
- vListDesc.set_base_addr (edit .vList );
95
+ vListDesc.set_base_addr (definedIoArgs .vList );
95
96
vListDesc.GetDimension (0 ).SetBounds (1 , edit.vListEntries );
96
97
vListDesc.GetDimension (0 ).SetByteStride (
97
98
static_cast <SubscriptValue>(sizeof (int )));
0 commit comments