Skip to content

EscapeAnalysis: handle SILUndef values #24372

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

Merged
merged 1 commit into from
Apr 29, 2019

Conversation

eeckstein
Copy link
Contributor

@eeckstein eeckstein commented Apr 29, 2019

fixes a crash

https://bugs.swift.org/browse/SR-10580
rdar://problem/50279857

fixes a crash

rdar://problem/50279857
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test and merge

@@ -1070,6 +1070,11 @@ static bool mayContainReference(SILType Ty, const SILFunction &F) {

bool EscapeAnalysis::isPointer(ValueBase *V) {
auto *F = V->getFunction();

// The function can be null, e.g. if V is an undef.
if (!F)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for this to happen for anything but undef? Maybe put in an assert?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think currently not. This is the safe default (in case we add another SILValue kind in the future)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but we won't know to update this code when someone adds something new. They won't be able to know to make the decision. With the assert, when someone adds the new SILValue, they get a hard warning that they may need to update this code.

@gottesmm
Copy link
Contributor

@compnerd I think this is the fix for what you were saying on the lldb bots.

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.

3 participants