summaryrefslogtreecommitdiff
path: root/flang-rt/lib/runtime/pointer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang-rt/lib/runtime/pointer.cpp')
-rw-r--r--flang-rt/lib/runtime/pointer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/flang-rt/lib/runtime/pointer.cpp b/flang-rt/lib/runtime/pointer.cpp
index 7331f7bbc3a7..04487abd3272 100644
--- a/flang-rt/lib/runtime/pointer.cpp
+++ b/flang-rt/lib/runtime/pointer.cpp
@@ -115,10 +115,12 @@ void RTDEF(PointerAssociateRemapping)(Descriptor &pointer,
byteStride *= dim.Extent();
}
}
- if (pointer.Elements() > target.Elements()) {
+ std::size_t pointerElements{pointer.Elements()};
+ std::size_t targetElements{target.Elements()};
+ if (pointerElements > targetElements) {
terminator.Crash("PointerAssociateRemapping: too many elements in remapped "
"pointer (%zd > %zd)",
- pointer.Elements(), target.Elements());
+ pointerElements, targetElements);
}
}