swift
bdf40184 - [Frontend] Fix a small `unique_ptr` array access.

Commit
1 year ago
[Frontend] Fix a small `unique_ptr` array access. When the size of the array accessed here is zero, retrieving the address of the zero-th element here is undefined. When the frontend is linked against a libc++ that has the `unique_ptr` hardening in [this commit](https://github.com/llvm/llvm-project/commit/18df9d23ea390eaa50b41f3083a42f700a2b0e39) enabled, it traps here. Instead, simply call `.get()` to retrieve the address of the array, which works even when it is a zero-byte allocation.
Author
Parents
Loading