mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
f77bebbd29
Safe wrapper expansions included an explicit unwrap of the baseAddress of the span parameter unless the underlying pointer parameter was explicitly `_Nullable`. Since the baseAddress can only be null if the count is 0, and the pointer is annotated with counted_by, it is not allowed to dereference the zero-length buffer, even if the nullability is not set (i.e. the underlying function parameter is imported with an implicitly unwrapped optional type). For consistency, this also adds the same early exit handling for the return value as for nullable return values. rdar://177555277