D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17450 - escaping delegate context pointer not detected for member functions
Summary: escaping delegate context pointer not detected for member functions
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: safe
Depends on:
Blocks:
 
Reported: 2017-05-28 23:47 UTC by Walter Bright
Modified: 2017-08-07 13:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Walter Bright 2017-05-28 23:47:22 UTC
alias dg_t = void delegate();

struct S {
    @safe dg_t foo1(ref S s) {
        return &s.bar; // should detect an error
    }
    @safe dg_t foo2(ref S s) {
        return &bar; // should detect an error
    }
    @safe void bar();
}
Comment 1 Walter Bright 2017-05-28 23:55:47 UTC
https://github.com/dlang/dmd/pull/6839
Comment 2 github-bugzilla 2017-05-29 12:22:59 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/e3e8ce24b0ca5b0aa0f300da854fef439973df03
fix Issue 17450 - escaping delegate context pointer not detected for member functions

https://github.com/dlang/dmd/commit/b0b461765dc8c8baf1d615ce3600948e990daa56
Merge pull request #6839 from WalterBright/fix17450

fix Issue 17450 - escaping delegate context pointer not detected for …
merged-on-behalf-of: Daniel Murphy <yebblies@gmail.com>
Comment 3 github-bugzilla 2017-08-07 13:16:28 UTC
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/e3e8ce24b0ca5b0aa0f300da854fef439973df03
fix Issue 17450 - escaping delegate context pointer not detected for member functions

https://github.com/dlang/dmd/commit/b0b461765dc8c8baf1d615ce3600948e990daa56
Merge pull request #6839 from WalterBright/fix17450