From 77ab08e1ffa875f0e739357b81cdb197ff19ecb0 Mon Sep 17 00:00:00 2001 From: Jean Perier Date: Mon, 16 Oct 2023 23:59:15 -0700 Subject: [PATCH] [flang][runtime] fix buildbot failure after #69199 Fix https://lab.llvm.org/buildbot/#/builders/268/builds/360 --- flang/include/flang/Runtime/descriptor.h | 3 ++- flang/runtime/ISO_Fortran_binding.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flang/include/flang/Runtime/descriptor.h b/flang/include/flang/Runtime/descriptor.h index 85240353e8ae9e..a5747f98ff2bd4 100644 --- a/flang/include/flang/Runtime/descriptor.h +++ b/flang/include/flang/Runtime/descriptor.h @@ -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 diff --git a/flang/runtime/ISO_Fortran_binding.cpp b/flang/runtime/ISO_Fortran_binding.cpp index c2e82758ae08ae..ce146844533a06 100644 --- a/flang/runtime/ISO_Fortran_binding.cpp +++ b/flang/runtime/ISO_Fortran_binding.cpp @@ -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) {