mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add an assert to ArrayBuffer.getElementSlowPath.
The implementation is making a strong assumption about the array element type (single-reference layout), but it is extremely non-obvious that this helper is only called for those element types. Swift SVN r30183
This commit is contained in:
@@ -372,6 +372,7 @@ extension _ArrayBuffer {
|
||||
|
||||
@inline(never)
|
||||
func _getElementSlowPath(i: Int) -> AnyObject {
|
||||
assert(_isClassOrObjCExistential(Element.self), "Only single reference elements can be indexed here.")
|
||||
let element: AnyObject
|
||||
if _isNative {
|
||||
// _isValidSubscript does no subscript checking for the slow path.
|
||||
|
||||
Reference in New Issue
Block a user