https://issues.dlang.org/show_bug.cgi?id=21425

          Issue ID: 21425
           Summary: Using va_start twice results in wrong values
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: tim.dl...@t-online.de

The following code fails with dmd v2.094.1 under Linux x86_64:

import core.vararg;

extern(C) void f(int dummy, ...)
{
        va_list ap;

        va_start(ap, dummy);
        int x = va_arg!int(ap);
        assert(x == 5);
        va_end(ap);

        va_start(ap, dummy);
        int y = va_arg!int(ap);
        assert(y == 5);
        va_end(ap);
}

int main()
{
        f(0, 5);
        return 0;
}

Issue 14131 could be related.

--

Reply via email to