[Issue 2479] Badcode regression: closure corrupts _argptr value

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 2 00:20:20 PST 2009


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



--- Comment #6 from Don <clugdbug at yahoo.com.au> 2009-11-02 00:20:19 PST ---
I have patched Phobos so that original symptom is fixed.
The compiler bug is that in FuncDeclaration::buildClosure() in toir.c, variadic
arguments aren't supported, but _argptr is set in FuncDeclaration::semantic3()
as if they were.

Partial patch, to turn this from a wrong-code into a rejects-valid bug, until
the bug is actually fixed:
func.c, line 1282.
---
        if (argptr)
        {    // Initialize _argptr to point past non-variadic arg
#if IN_GCC
        // Handled in FuncDeclaration::toObjFile
        v_argptr = argptr;
        v_argptr->init = new VoidInitializer(loc);
#else
+        // BUG: Fix this in FuncDeclaration::buildClosure() in toir.c.
+        if (needsClosure())
+            error("Closures are not yet supported with variadic arguments
(Bugzilla 2479)");
        Type *t = argptr->type;
        VarDeclaration *p;
        unsigned offset;

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