Skip to content

Instantly share code, notes, and snippets.

@omochi
Last active May 26, 2017 08:34
Show Gist options
  • Save omochi/7d1049dc09696092e49473695a4effd4 to your computer and use it in GitHub Desktop.
Save omochi/7d1049dc09696092e49473695a4effd4 to your computer and use it in GitHub Desktop.
class StrBox {
init(name: String) {
self.name = name
}
var name: String
}
class Cat {
var nameBox: StrBox
init(other: Cat) {
nameBox = other.createName()
}
func createName() -> StrBox {
return self.nameBox
}
convenience init() {
self.init(other: self)
}
}
let cat = Cat()
/*
[omochi@omochi-MB b]$ swift a.swift
0 swift 0x0000000105de64f7 PrintStackTraceSignalHandler(void*) + 39
1 swift 0x0000000105de59a6 SignalHandler(int) + 646
2 libsystem_platform.dylib 0x00007fffa6353b3a _sigtramp + 26
3 libsystem_platform.dylib 0x00000000000003f8 _sigtramp + 1506461912
4 libsystem_platform.dylib 0x0000000107e33251 _sigtramp + 1638790961
5 libsystem_platform.dylib 0x0000000107e332bb _sigtramp + 1638791067
6 libsystem_platform.dylib 0x0000000107e332f6 _sigtramp + 1638791126
7 libsystem_platform.dylib 0x0000000107e3302b _sigtramp + 1638790411
8 swift 0x000000010372edcf llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 655
9 swift 0x00000001037349c3 llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, char const* const*) + 707
10 swift 0x0000000102c31c69 swift::RunImmediately(swift::CompilerInstance&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, swift::IRGenOptions&, swift::SILOptions const&) + 3385
11 swift 0x0000000102c06622 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 50738
12 swift 0x0000000102bb3d6c main + 9052
13 libdyld.dylib 0x00007fffa6144235 start + 1
14 libdyld.dylib 0x000000000000000a start + 1508621782
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret a.swift -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name a
Segmentation fault: 11
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment