加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Swift编译器分割错误时建立

发布时间:2020-12-14 06:13:09 所属栏目:百科 来源:网络整理
导读:在我的UIViewExtension.swift文件中添加一个(方便的)计算的height属性到UIView会导致Swift编译器segfault …什么可能会出错? 0 swift 0x00000001061e5608 llvm::sys::PrintStackTrace(__sFILE*) + 401 swift 0x00000001061e5af4 SignalHandler(int) + 4522
在我的UIViewExtension.swift文件中添加一个(方便的)计算的height属性到UIView会导致Swift编译器segfault …什么可能会出错?
0  swift                    0x00000001061e5608 llvm::sys::PrintStackTrace(__sFILE*) + 40
1  swift                    0x00000001061e5af4 SignalHandler(int) + 452
2  libsystem_platform.dylib 0x00007fff894da5aa _sigtramp + 26
3  libsystem_platform.dylib 0xb03939841e997c88 _sigtramp + 2504775416
4  swift                    0x00000001064c8bb9 swift::NominalTypeDecl::getMembers(bool) const + 41
5  swift                    0x00000001055efab9 swift::irgen::ClassMetadataLayout<(anonymous namespace)::FindClassMethodIndex>::addClassMembers(swift::ClassDecl*) + 329
6  swift                    0x00000001055e97b2 swift::irgen::emitVirtualMethodValue(swift::irgen::IRGenFunction&,llvm::Value*,swift::SILType,swift::SILDeclRef,swift::CanTypeWrapper<swift::SILFunctionType>,swift::ResilienceExpansion) + 434
7  swift                    0x00000001056550d3 swift::SILVisitor<(anonymous namespace)::IRGenSILFunction,void>::visit(swift::ValueBase*) + 42611
8  swift                    0x000000010564a266 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 8678
9  swift                    0x00000001055cb6f8 swift::irgen::IRGenModule::emitGlobalTopLevel() + 184
10 swift                    0x00000001056376e3 performIRGeneration(swift::IRGenOptions&,swift::Module*,swift::SILModule*,llvm::StringRef,llvm::LLVMContext&,swift::SourceFile*,unsigned int) + 1859
11 swift                    0x0000000105638033 swift::performIRGeneration(swift::IRGenOptions&,swift::SourceFile&,unsigned int) + 51
12 swift                    0x00000001055aa65a frontend_main(llvm::ArrayRef<char const*>,char const*,void*) + 4842
13 swift                    0x00000001055a935d main + 1533
14 libdyld.dylib            0x00007fff8a82e5fd start + 1
1.  While emitting IR SIL function @_TFCSo6UIViewg6heightSd for 'anonname=0x7ff422892fd0' at <path redacted>/UIViewExtension.swift:60:5
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254

如果需要更多的信息来破解这个,只是评论。谢谢!

编辑:

这里是一个相关的.xcodeproj返回这个问题的编译器错误。 Download here

我有这个错误,因为我这样做:
if(currentMeal?.State == .Deleted){

}

代替

if(currentMeal!.State == .Deleted){

}

所以我认为可选未解包在if条件可能会导致此错误

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读