www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3781] New: ICE(interpret.c): mixin non-CTFE function

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3781

           Summary: ICE(interpret.c): mixin non-CTFE function
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: strtr despam.it


--- Comment #0 from strtr despam.it 2010-02-08 00:52:11 PST ---
void _mixin() {
    writefln( "" );
}
void main() {
    mixin( _mixin );
} 
//Assertion failure: '!dim || (parameters && (parameters->dim == dim))' on line
140 in file 'interpret.c'
With both D1.056 and D2.040

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 08 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3781


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code, patch
                 CC|                            |clugdbug yahoo.com.au
            Version|unspecified                 |1.055
           Severity|normal                      |regression


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-02-09 00:25:05 PST ---
Reduced test case for test suite:
-----
void badvariadic(...) {}
static assert(!is(typeof(mixin(badvariadic()))));
---

PATCH: interpret.c line 118. The check for C-style variadics failed in the case
where there were no non-variadic parameters.

    TypeFunction *tf = (TypeFunction *)tb;
    Type *tret = tf->next->toBasetype();
-    if (tf->varargs && arguments && parameters && arguments->dim !=
parameters->dim)
+    if (tf->varargs && arguments && (parameters && arguments->dim !=
parameters->dim) || (!parameters && arguments->dim))
    {    cantInterpret = 1;
    error("C-style variadic functions are not yet implemented in CTFE");
    return NULL;
    }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3781



--- Comment #2 from Don <clugdbug yahoo.com.au> 2010-02-09 01:21:47 PST ---
Oops, there's a missing parentheses. Should be:

if (tf->varargs && arguments && ((parameters && arguments->dim !=
parameters->dim) || (!parameters && arguments->dim)))

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3781


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com


--- Comment #3 from Walter Bright <bugzilla digitalmars.com> 2010-02-11
22:26:10 PST ---
Changeset 376

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 11 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3781


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #4 from Walter Bright <bugzilla digitalmars.com> 2010-03-08
22:23:42 PST ---
Fixed dmd 1.057 and 2.041

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