[Issue 6306] [CTFE] Strange behavior of indirect recursive call in CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 27 00:25:45 PDT 2011


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2011-07-27 00:25:42 PDT ---
Reduced test case shows this is very nasty bug in failing to restore local
variable values after an indirect recursive call.
-------------
void recurse6306() {
    bug6306(false);
}

bool bug6306(bool b) {
    int x = 0;
    if (b)
        recurse6306();
    assert(x == 0); // fails!!!!!
    x = 1;
    return true;
}

static assert( bug6306(true) );

-- 
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