Skip to content

Commit 6db2465

Browse files
[Flang][Runtime] Fix implicit conversion warning when targeting 32bit… (#99465)
… architecture On 32 bit systems, TypeParameterValue is 64bit wide while CFI_index_t is 32bit wide.
1 parent ecaacd1 commit 6db2465

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

flang/runtime/derived.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ static RT_API_ATTRS void GetComponentExtents(SubscriptValue (&extents)[maxRank],
2323
const typeInfo::Component &comp, const Descriptor &derivedInstance) {
2424
const typeInfo::Value *bounds{comp.bounds()};
2525
for (int dim{0}; dim < comp.rank(); ++dim) {
26-
SubscriptValue lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)};
27-
SubscriptValue ub{
28-
bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)};
29-
extents[dim] = ub >= lb ? ub - lb + 1 : 0;
26+
auto lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)};
27+
auto ub{bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)};
28+
extents[dim] = ub >= lb ? static_cast<SubscriptValue>(ub - lb + 1) : 0;
3029
}
3130
}
3231

0 commit comments

Comments
 (0)