Skip to content

Conversation

JDevlieghere
Copy link

SupportFileSP should never be null, and instead should use a default constructed SupportFile to represent an invalid instance. This is because the class used to be a value type before it became polymorphic.

We have various places in LLDB where we check this precondition, including in DisplaySourceLinesWithLineNumbers. The assertion was tripped when calling GetStartLineSourceInfo which starts by resetting the SupportFileSP and has a series of early returns which leave the shared pointer in that state.

rdar://161607247
(cherry picked from commit eb06c7e)

SupportFileSP should never be null, and instead should use a default
constructed SupportFile to represent an invalid instance. This is
because the class used to be a value type before it became polymorphic.

We have various places in LLDB where we check this precondition,
including in DisplaySourceLinesWithLineNumbers. The assertion was
tripped when calling GetStartLineSourceInfo which starts by resetting
the SupportFileSP and has a series of early returns which leave the
shared pointer in that state.

rdar://161607247
(cherry picked from commit eb06c7e)
@JDevlieghere
Copy link
Author

@swift-ci test

@JDevlieghere JDevlieghere merged commit 0252faa into stable/21.x Oct 10, 2025
3 checks passed
@JDevlieghere JDevlieghere deleted the rdar161607247 branch October 10, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant