Skip to content

Commit 410f751

Browse files
[Flang][Runtime] Fix type used to store result of typeInfo::Value::Ge… (llvm#105589)
…tValue Current choice was only working out of accident on 64 bit machine, it led to an implicit cast to smaller type on 32 bit machine. Use the exact type instead.
1 parent fde2d23 commit 410f751

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flang/runtime/copy.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ RT_API_ATTRS void CopyElement(const Descriptor &to, const SubscriptValue toAt[],
183183
const typeInfo::Value *bounds{component->bounds()};
184184
std::size_t elements{1};
185185
for (int dim{0}; dim < component->rank(); ++dim) {
186-
SubscriptValue lb{bounds[2 * dim].GetValue(&curTo).value_or(0)};
187-
SubscriptValue ub{
186+
typeInfo::TypeParameterValue lb{
187+
bounds[2 * dim].GetValue(&curTo).value_or(0)};
188+
typeInfo::TypeParameterValue ub{
188189
bounds[2 * dim + 1].GetValue(&curTo).value_or(0)};
189190
extents[dim] = ub >= lb ? ub - lb + 1 : 0;
190191
elements *= extents[dim];

0 commit comments

Comments
 (0)