Posts

Post not yet marked as solved
3 Replies
3.5k Views
```swift public static func instance(by queryItem: [String: String]) -> Self? { let items = queryItem.map({ ($0.key.lowercased(), $0.value) }) let dict = [String: String](uniqueKeysWithValues: items) var _url: String? if let value = dict["url"] { _url = value } var title: String? if let value = dict["title"] { title = value } guard let url = _url else { return nil } return PRWebview( url: url, title: title ) }```When I archive the iOS project, will faild with error: Segmentation fault: 11```1. While running pass #153921 SILFunctionTransform "DCE" on SILFunction "@$s23URLNavigatorExt_Example6RouterO9PRWebviewV8instance2byAESgSDyS2SG_tFZ".for 'instance(by:)' (at /Users/phil/Documents/WorkSpace/ky_tech/URLNavigatorExt/Example/URLNavigatorExt/generated/Router.generated.swift:989:20)0 swift 0x0000000104fdea63 PrintStackTraceSignalHandler(void*) + 511 swift 0x0000000104fde236 SignalHandler(int) + 3582 libsystem_platform.dylib 0x00007fff5b7bfb5d _sigtramp + 293 libsystem_platform.dylib 0x0000000106644e00 _sigtramp + 28673522564 swift 0x000000010134c370 (anonymous namespace)::DCE::markControllingTerminatorsLive(swift::SILBasicBlock*) + 8005 swift 0x000000010134bca2 (anonymous namespace)::DCE::markValueLive(swift::SILNode*) + 4666 swift 0x00000001013495e8 (anonymous namespace)::DCE::run() + 27287 swift 0x00000001012d0f3e swift::SILPassManager::execute() + 46068 swift 0x0000000100f2f96b swift::CompilerInstance::performSILProcessing(swift::SILModule*, swift::UnifiedStatsReporter*) + 63799 swift 0x0000000100c27ec5 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 3392510 swift 0x0000000100c1c234 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 682011 swift 0x0000000100ba9733 main + 121912 libdyld.dylib 0x00007fff5b5d43d5 start + 113 libdyld.dylib 0x0000000000000056 start + 2762128514error: Segmentation fault: 11 (in target 'URLNavigatorExt_Example' from project 'URLNavigatorExt')```If I change the code```swift var _url: String? if let value = dict["url"] { _url = value }// to var _url: String? = dict["url"]```This archive will be successfulI create a demo projecthttps://github.com/philCc/URLNavigatorExt.gitbranch:Segmentation_fault_11
Posted
by phil82.
Last updated
.