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-7197] Swift 4 Compiler Segfault while parsing incorrect code. #49745

Closed
swift-ci opened this issue Mar 14, 2018 · 2 comments
Closed

[SR-7197] Swift 4 Compiler Segfault while parsing incorrect code. #49745

swift-ci opened this issue Mar 14, 2018 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-7197
Radar rdar://problem/38505436
Original Reporter cogk (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment
$ swift --version
Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee cogk (JIRA)
Priority Medium

md5: 1b358fe88d6cdd3810d31d435660609b

Issue Description:

Description

When running the swift or swiftc command line tools on the following code, the compiler crashes while type-checking an init() declaration.

The following code declares a nested class inside a protocol, which is invalid.
But it also declares a subclass of the nested class, and the compiler exits with a Segmentation fault: 11.

protocol Proto {
  class Nested {
    // init() {}
  }
}

class Subclass: Proto.Nested {
  // override init() {}
}

The compiler type-checks init() even if not explicitly written in the code.

Steps to recreate the issue

Run one of the following commands :

swift file.swift

or

swiftc file.swift

Notes

I have not tested if the issue exists when running/compiling the code in an Xcode project or Playground.

I joined the stack trace produced (stderr.txt).

@belkadan
Copy link
Contributor

@swift-ci create

@xedin
Copy link
Member

xedin commented Mar 17, 2018

Should be resolved by #15307 it has been merged to master. cogk (JIRA User) Thank you for report, please use next nightly master snapshot (or better one from upcoming Saturday) to verify.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 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 crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

4 participants