Summary: D2 core.sys.posix.setjmp segfaults
           Product: D
           Version: 2.041
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime

--- Comment #0 from Shin Fujishiro <> 2010-05-17 00:41:40 PDT 
This program core dumps on FreeBSD (and it should on Linux):
import core.sys.posix.setjmp;

void main()
    jmp_buf st = void;

    assert(0); // trap; not reached due to the bug

The C standard defines jmp_buf as an array.  In C and D1, the definition works
since arrays (static arrays) are passed to functions by reference.  But in D2,
static arrays are passed by value!  Hence the above program core dumps.

So, setjmp() and longjmp() must be declared as:
int  setjmp(ref jmp_buf);
void longjmp(ref jmp_buf, int);

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to