1841 Closure detection fails in nested functions #1554

Merged
merged 1 commit into from Jan 27, 2013

Conversation

Projects
None yet
3 participants
@donc
Collaborator

donc commented Jan 26, 2013

If an escaping function doesn't use any closure variables itself, but is ultimately calls another nested function which does, it must be marked as needing a closure.

This 'calling a sibling nested function' case was missing. I've fixed this by constructing a simple call graph for nested functions. Note that nested functions cannot be forward referenced by other nested functions, so the call graph is a simple tree, with no cycles, and that makes it trivial to traverse.

Fix issue 1841 Closure detection fails in nested functions
If an escaping function doesn't use any closure variables, but
calls another nested function which does, it must be marked as
needing a closure. This 'calling a sibling' case was missing.
@WalterBright

This comment has been minimized.

Show comment Hide comment

WalterBright added a commit that referenced this pull request Jan 27, 2013

Merge pull request #1554 from donc/closure1841
1841 Closure detection fails in nested functions

@WalterBright WalterBright merged commit 9ffbf88 into dlang:master Jan 27, 2013

1 check passed

default Pass: 10
Details
@WalterBright

This comment has been minimized.

Show comment Hide comment
@WalterBright

WalterBright Jan 29, 2013

Member

@donc donc deleted the don-clugston-sociomantic:closure1841 branch Jul 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment