[Issue 3549] Bypassing initializers with goto -- Is this a bug?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 24 20:00:15 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3549


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au
            Summary|Is this a bug?              |Bypassing initializers with
                   |                            |goto -- Is this a bug?


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2009-11-24 20:00:14 PST ---
I don't know. That's an interesting case for safe D. In safe D, either the
initializers must be executed, or bypassing them must be banned. The code below
is an example of memory corruption. But as @safe isn't yet implemented (so far
it only checks for use of asm, AFAIK), it's not a bug yet.

-----
class Foo { int x; }

@safe
void foo()
{
   goto xxx;
   Foo a = new Foo();
xxx:
   a.x = 8;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list