Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-10644] Swift compiler crash using scoped constants as default values for parameters #53044

Closed
swift-ci opened this issue May 8, 2019 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented May 8, 2019

Previous ID SR-10644
Radar None
Original Reporter mrylmz (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

macOS Mojave Version 10.14.4 (18E226)

Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)

Target: x86_64-apple-darwin18.5.0

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 3b91fd6c6fa5c8d32c3484fd45e2adeb

duplicates:

  • SR-2189 Nested function with local default value crashes

Issue Description:

The swift compiler crashes when constant values in the scope of a function are used as default value of parameters in a nested function.

The expected Behaviour would be a successful Build if this is semantically correct code or an compilation error message.

Crash Log

warning: 'swift run file.swift' command to interpret swift files is deprecated; use 'swift file.swift' instead
Global is external, but doesn't have external or weak linkage!
i8* ()* @"$s8Contents10myTestFuncyyF0B5ConstL_Sivau"
<unknown>:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
<unknown>:0: note: Broken module found, compilation aborted!
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret Contents.swift -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -color-diagnostics -module-name Contents 
0  swift                    0x000000010cd45ee3 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x000000010cd456bc SignalHandler(int) + 348
2  libsystem_platform.dylib 0x00007fff5f3cbb5d _sigtramp + 29
3  libsystem_platform.dylib 0x000000011910bb76 _sigtramp + 3117678646
4  libsystem_c.dylib        0x00007fff5f28b6a6 abort + 127
5  swift                    0x0000000108b9dcf8 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_1::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 936
6  swift                    0x000000010ccf6826 llvm::report_fatal_error(llvm::Twine const&, bool) + 278
7  swift                    0x000000010ccf670b llvm::report_fatal_error(char const*, bool) + 43
8  swift                    0x000000010ccbcbec (anonymous namespace)::VerifierLegacyPass::doFinalization(llvm::Module&) + 204
9  swift                    0x000000010cc60863 llvm::FPPassManager::doFinalization(llvm::Module&) + 51
10 swift                    0x000000010cc68252 llvm::legacy::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 82
11 swift                    0x0000000108d83425 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 4661
12 swift                    0x0000000108d887ca performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**) + 2026
13 swift                    0x0000000108d85c6f swift::performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, llvm::GlobalVariable**) + 735
14 swift                    0x0000000108baa746 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 50502
15 swift                    0x0000000108b9a92e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6862
16 swift                    0x0000000108b389ce main + 1246
17 libdyld.dylib            0x00007fff5f1e63d5 start + 1
Abort trap: 6
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant