홈>
'AnyArrayBox'를 직렬화하는 동안 세그먼트 오류가 나타납니다
- 런닝 패스 # 0 SILModuleTransform "SerializeSILPass"동안.
- 'AnyArrayBox'를 직렬화하는 동안 (모듈 '모듈') 0 스위프트 0x000000010d7abeb3 PrintStackTraceSignalHandler (void *) + 51 신속한 1 개 0x000000010d7ab686 SignalHandler (int) + 358 2 libsystem_platform.dylib 0x00007fff76c31b5d _sigtramp + 29
AnyArray 구조체는 다음과 같습니다
struct AnyArray<Element>: RandomAccessCollection {
typealias Index = Int
private let box: AnyArrayBase<Element>
init<Concrete: RandomAccessCollection>(_ concrete: Concrete) where Concrete.Element == Element, Concrete.Indices == Indices {
box = AnyArrayBox(concrete)
}
var startIndex: Int { return box.startIndex }
var endIndex: Int { return box.endIndex }
func index(after i: Int) -> Int {
return box.index(after: i)
}
subscript(position: Index) -> Element {
return box[position]
}
}
그리고 거기에 사용되는 다른 두 사람
private class AnyArrayBase<Element>: RandomAccessCollection {
init() {
guard type(of: self) != AnyArrayBase.self else {
fatalError("_AnyArrayBase<Element> is an abstract class, it can not be created; create subclass instance instead")
}
}
typealias Index = Int
var startIndex: Int { fatalError("Must override") }
var endIndex: Int { fatalError("Must override") }
func index(after i: Int) -> Int {
fatalError("Must override")
}
subscript(position: Index) -> Element {
fatalError("Must override")
}
}
private final class AnyArrayBox<Concrete: RandomAccessCollection>: AnyArrayBase<Concrete.Element> where Concrete.Indices == AnyArrayBase<Concrete.Element>.Indices {
private let concrete: Concrete
init(_ concrete: Concrete) {
self.concrete = concrete
}
override var startIndex: Int { return concrete.startIndex }
override var endIndex: Int { return concrete.endIndex }
override func index(after i: Int) -> Int {
return concrete.index(after: i)
}
override subscript(position: Index) -> Element {
return concrete[position]
}
}
어떻게 고칠 수 있습니까? 추천 사항이 있나요?
-
답변 # 1
관련 자료
- swift - xcode 114 - 보관 프로젝트 :분할 오류 11
- c - printf는 어떻게 세분화 오류를 피합니까?
- c - for 루프에서 포인터에 액세스하는 동안 세그먼트 오류 발생
- c - getline을 사용하는 동안 분할 오류 (코어 덤프)가 발생합니다
- c++ - sf - : window :: close를 호출 한 후 sfml의 분할 오류
- trie C ++에서 분할 오류 수정
- scipy - 희소 행렬로 인해 분할 오류 종료 코드 139가 발생 함
- c++ - 이 코드로 인해 세분화 오류 오류가 발생하는 이유는 무엇입니까?
- C의 파일에 대한 세그먼테이션 결함
- C ++ 멀티 스레딩 뮤텍스로 세그먼테이션 오류 잠금
- fortran - ifort 190 및 gfortran 91 컴파일러를 사용한"where-statement"의 분할 오류
- c++ - 세그먼트 오류?
- x86 - nasm 어셈블리에서 함수를 호출하는 동안 세그먼트 오류
- c - 파일에서 다음 줄/문자를 읽으려고 할 때 분할 오류
- c++ - 기능상 세분화 결함 얻기
- c++ - line head = NULL에 세그먼테이션 오류 오류가 발생했습니다
- C에서 새 파일을 만들 때 분할 오류
- C의 널 포인터 할당 오류, 코드의 분할 오류 오류
- c - 아토이 구현 - 변수 j를 증분 할 때 분할 오류
관련 질문
- ios - SwiftUI는 스택 요소를 전경으로 가져옵니다
- ios - CollectionView 콘텐츠보기가 viewdidload시 업데이트/새로 고침되지 않음
- swift - IOS는 URL에서 UITableView 배경 이미지 설정
- swift - StateObject를 매개 변수로 사용하여 뷰를 초기화하는 방법은 무엇입니까?
- swift - SwiftUI의 하위보기에서 특정 상태 변경 애니메이션을 비활성화하려면 어떻게해야합니까?
- xcode - Swift 쉘 명령이 빈 결과를 반환합니다
- ios - 버튼 클릭시 버튼 이미지 변경 Xcode
- swift - Xcode 디버그 콘솔에서 "인식 할 수없는 선택기"라는 오류 메시지가 나타나는 이유
- ios - swift 5 - 함수 내에서 실행할 함수를 전달하는 방법 () noobie in swift
- Xcode Playground Swift 함수 클로저 평가
Xcode 11.0 (11A420a)으로 옮길 때도 같은 문제가있었습니다 그것은 구조의 일부로 튜플을 가지고있는 줄을 가리 켰습니다.
다른 구조로 변경하여 문제를 해결했습니다.