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-12691] Unceremonious crasher #55135

Closed
dabrahams opened this issue Apr 28, 2020 · 3 comments
Closed

[SR-12691] Unceremonious crasher #55135

dabrahams opened this issue Apr 28, 2020 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@dabrahams
Copy link
Collaborator

Previous ID SR-12691
Radar rdar://problem/62895062
Original Reporter @dabrahams
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 778662bd6dcff4dd60e64f55fe546354

Issue Description:

This crashes the compiler with no backtrace. I'm sure it can be reduced, but it's pretty small already.

Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
Target: x86_64-apple-darwin19.4.0

struct CountSteps1<T> : Collection {
  init(count: Int) { self.count = count }
  var count: Int

  var startIndex: Int { 0 }
  var endIndex: Int { count }
  func index(after i: Int) -> Int { 
    totalSteps += 1
    return i + 1
  }
  subscript(i: Int) -> Int { return i }
}

extension CountSteps1
  : RandomAccessCollection, BidirectionalCollection 
     where T : Equatable 
{
  func index(_ i: Index, offsetBy d: Int) -> Index {
    return i + d
  }
}
@beccadax
Copy link
Contributor

beccadax commented May 5, 2020

@swift-ci create

@CodaFi
Copy link
Member

CodaFi commented May 9, 2020

Huh, simplifying this lead me to discover the root cause of a memory smasher involving diagnostics with same-type constraints. Thanks!

@slavapestov
Copy link
Member

No longer crashes, adding a regression test: #33550

@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

4 participants