Skip to content

Commit

Permalink
[Flang][Runtime] Fix implicit conversion warning when targeting 32bit… (
Browse files Browse the repository at this point in the history
#99465)

… architecture

On 32 bit systems, TypeParameterValue is 64bit wide while CFI_index_t is
32bit wide.
  • Loading branch information
serge-sans-paille authored Jul 21, 2024
1 parent ecaacd1 commit 6db2465
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flang/runtime/derived.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ static RT_API_ATTRS void GetComponentExtents(SubscriptValue (&extents)[maxRank],
const typeInfo::Component &comp, const Descriptor &derivedInstance) {
const typeInfo::Value *bounds{comp.bounds()};
for (int dim{0}; dim < comp.rank(); ++dim) {
SubscriptValue lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)};
SubscriptValue ub{
bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)};
extents[dim] = ub >= lb ? ub - lb + 1 : 0;
auto lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)};
auto ub{bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)};
extents[dim] = ub >= lb ? static_cast<SubscriptValue>(ub - lb + 1) : 0;
}
}

Expand Down

0 comments on commit 6db2465

Please sign in to comment.