[libcxx-commits] [PATCH] D155649: [libc++] Make sure we use the libdispatch backend on Apple platforms

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 20 10:22:12 PDT 2023


ldionne marked an inline comment as done.
ldionne added inline comments.


================
Comment at: libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h:181-182
     _Reduction __reduction) {
+  if (__first == __last)
+    return __init;
+
----------------
philnik wrote:
> I don't understand this change. Is this just an optimization, or is something here assuming a size > 0?
Otherwise we crash below:

```
std::__construct_at(__values.get() + __chunk, __reduction(__first + __index + 2, __first + __index + __this_chunk_size, __combiner(__transform(__first + __index), __transform(__first + __index + 1))));
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155649/new/

https://reviews.llvm.org/D155649



More information about the libcxx-commits mailing list