Skip to content

Prevent null pointer 'Type' from being dereferenced #295

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

Conversation

AlexDenisov
Copy link
Contributor

Fixes 323 crashes.
/cc @DougGregor

@jtbandes
Copy link
Contributor

jtbandes commented Dec 7, 2015

->castTo<ArchetypeType>();
auto typeVar = createTypeVariable(getConstraintLocator(
Type mappedType = ArchetypeBuilder::mapTypeIntoContext(dc, gp);
if (mappedType) {
Copy link

Choose a reason for hiding this comment

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

What should happen if this check fails?

Copy link
Contributor

Choose a reason for hiding this comment

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

It would mean the archetype builder was not set up properly.

You could try to see what the offending 'gp' actually is, and what generic signature it comes from vs what generic signature the archetype builder was configured with.

Usually getting to the root cause of something leads to better code and fixes more crashes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I will dive deeper.

@AlexDenisov AlexDenisov force-pushed the archetype_null_pointer_dereference branch from cd9adc2 to 85ab00d Compare December 11, 2015 23:28
@AlexDenisov AlexDenisov deleted the archetype_null_pointer_dereference branch December 15, 2015 12:13
@AlexDenisov
Copy link
Contributor Author

Fixed by c258f99

slavapestov pushed a commit to slavapestov/swift that referenced this pull request Nov 27, 2018
Track armed events in muxnotes closely
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Add LineSDK to compatibility suite
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.

None yet

5 participants