Skip to content

[SILProfiler] Don't crash when coverage info for lazy getters is inco… #18744

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
Aug 16, 2018

Conversation

vedantk
Copy link
Contributor

@vedantk vedantk commented Aug 15, 2018

…mplete

ASTWalker visits a lazy_initializer_expr once within its associated
var_decl (by way of the parent nominal type). However, SILGen visits the
lazy_initializer_expr while inside of the var_decl's getter. The result
is that there is no coverage mapping information for the contents of the
lazy init within the getter's SILProfiler.

Fixing this will require reworking how profile counters are assigned to
be more in line with what SILGen needs.

As a stop-gap, this patch prevents SILGen from asserting that coverage
mappings are complete with a defensive check which prevents a crash seen
in SR-8429.

rdar://42792053

…mplete

ASTWalker visits a lazy_initializer_expr once within its associated
var_decl (by way of the parent nominal type). However, SILGen visits the
lazy_initializer_expr while inside of the var_decl's getter. The result
is that there is no coverage mapping information for the contents of the
lazy init within the getter's SILProfiler.

Fixing this will require reworking how profile counters are assigned to
be more in line with what SILGen needs.

As a stop-gap, this patch prevents SILGen from asserting that coverage
mappings are complete with a defensive check which prevents a crash seen
in SR-8429.

rdar://42792053
@vedantk
Copy link
Contributor Author

vedantk commented Aug 15, 2018

@swift-ci smoke test

@vedantk vedantk merged commit 6d467fd into swiftlang:master Aug 16, 2018
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