Skip to content

[SR-9770] Singleton Initializer can enter Infinite Loop #4611

Open
@swift-ci

Description

@swift-ci
Previous ID SR-9770
Radar https://bugreport.apple.com/web/?problemID=47576365
Original Reporter spamsencer (JIRA User)
Type Bug
Environment

Swift 4.2

Xcode 10.1 (10B61)

macOS 10.14.2 (18C54)

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

md5: 265449bf1b4b45378b6f0bec0aede923

Issue Description:

When creating a Swift Singleton object as follows:

static let sharedHandler = SomeHandler()

If the singleton initializes top-level variables at the time of initialization, and if those variables' initializers reference the singleton object, the execution thread enters an infinite loop.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions