Skip to content

Commit

Permalink
[flang][runtime] fix buildbot failure after llvm#69199
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanPerier committed Oct 17, 2023
1 parent bef3e8e commit 77ab08e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion flang/include/flang/Runtime/descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ class Descriptor {
bool stridesAreContiguous{true};
for (int j{0}; j < leadingDimensions; ++j) {
const Dimension &dim{GetDimension(j)};
stridesAreContiguous &= (bytes == dim.ByteStride()) | (dim.Extent() == 1);
stridesAreContiguous &=
(bytes == dim.ByteStride()) || (dim.Extent() == 1);
bytes *= dim.Extent();
}
// One and zero element arrays are contiguous even if the descriptor
Expand Down
2 changes: 1 addition & 1 deletion flang/runtime/ISO_Fortran_binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ RT_API_ATTRS int CFI_is_contiguous(const CFI_cdesc_t *descriptor) {
CFI_index_t bytes = descriptor->elem_len;
for (int j{0}; j < descriptor->rank; ++j) {
stridesAreContiguous &=
(bytes == descriptor->dim[j].sm) | (descriptor->dim[j].extent == 1);
(bytes == descriptor->dim[j].sm) || (descriptor->dim[j].extent == 1);
bytes *= descriptor->dim[j].extent;
}
if (stridesAreContiguous || bytes == 0) {
Expand Down

0 comments on commit 77ab08e

Please sign in to comment.