Skip to content

[SR-9654] Swift 5: Compiler crashes on SILGen for subscript with autoclosure argument #52098

@swift-ci

Description

@swift-ci
Previous ID SR-9654
Radar rdar://problem/47254122
Original Reporter broadway_lamb (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

5.0-DEVELOPMENT-SNAPSHOT-2019-01-13-a

Apple Swift version 5.0-dev (LLVM ed64f75263, Clang e5012f3421, Swift 5a827a9)

Target: x86_64-apple-darwin18.2.0

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CodeCoverage, CompilerCrash
Assignee @vedantk
Priority Medium

md5: aaa569abe2db3ea87736204ac2ff957c

Issue Description:

This code crashes the compiler when code coverage is enabled:

struct S {
  subscript(i: Int, autoclosure: @autoclosure () ->  Int) -> Int {
    get {
      return 0
    }
    set {

    }
  }
}

I am using the latest (5.0-DEVELOPMENT-SNAPSHOT-2019-01-13-a) snapshot.

The SPM project to reproduce the issue: https://github.com/broadwaylamb/CompilerCrasherAutoclosureSubscript

Run:

$ swift build
$ swift test --enable-code-coverage

--enable-code-coverage is important.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.code coverageArea → source tooling: code coveragecompilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of software

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions