Skip to content

[SR-9504] Segfault when referencing self in init() #51958

Closed
@swift-ci

Description

@swift-ci
Previous ID SR-9504
Radar None
Original Reporter sergiocampama (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)

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

md5: 7e722d71160f2e3ad76573ad6218efce

duplicates:

  • SR-9451 Compiler crash SILFunctionTransform "DefiniteInitialization"

Issue Description:

class Crash {
{{ var pointer: Crash}}
{{ init() { }}pointer = self {{}}}
{{}}}

When running `swift crash.swift`, the swift compiler will segfault with the following error:

1. While running pass #53 SILFunctionTransform "DefiniteInitialization" on SILFunction "@$S5crash5CrashCACycfc".1. While running pass #53 SILFunctionTransform "DefiniteInitialization" on SILFunction "@$S5crash5CrashCACycfc". for 'init()' at [FILE]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe 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