Commit bdf4018
committed
[Frontend] Fix a small
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](llvm/llvm-project@18df9d2)
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.unique_ptr array access.1 parent 62993ff commit bdf4018
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1988 | 1988 | | |
1989 | 1989 | | |
1990 | 1990 | | |
1991 | | - | |
| 1991 | + | |
1992 | 1992 | | |
1993 | 1993 | | |
1994 | 1994 | | |
| |||
0 commit comments