[Issue 19559] New: Unsound escape analysis of struct members

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 8 21:41:52 UTC 2019


          Issue ID: 19559
           Summary: Unsound escape analysis of struct members
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: yshuiv7 at gmail.com

This code shouldn't compile.

@safe void bad(int *p) {
    struct A {
        int z;
        @safe void badbad(int *p) { p = &z; }
    A badstuff;

@safe void main() {
    int *p = null;
    *p = 10; // <- boom



More information about the Digitalmars-d-bugs mailing list