www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4837] New: Assertion failure: '0' on line 608(614) in file 'constfold.c' during CTFE

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

           Summary: Assertion failure: '0' on line 608(614) in file
                    'constfold.c' during CTFE
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: stanislav.blinov gmail.com



13:05:21 PDT ---
Compilation fails with assertion in constfold.c:608 or constfold.c:614 for the
following code:

bool foo(T)(T t)
{
    t >>>= 1;       // triggers assertion for ubytes and ushorts
    // t = t >>> 1; // this compiles with no errors
    return true;
}

void main()
{
    auto g1 = foo!ubyte(1); // Ok for runtime
    auto g2 = foo!ushort(1); // Ok for runtime

    // CTFE:
    enum e1 = foo!ubyte(1);  // Assertion failure: '0' on line 608 in file
'constfold.c'
    enum e2 = foo!ushort(1); // Assertion failure: '0' on line 614 in file
'constfold.c'
}

DMD 2.048

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


simon <s.d.hammett googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|nobody puremagic.com        |s.d.hammett googlemail.com



---
Created an attachment (id=814)
PATCH against rev 755: remove superfluous asserts

fixed, no idea why asserts where placed in there.
unsigned shifting of 8 ^ 16 bit values seems perfectly reasonable.

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





 Created an attachment (id=814) [details]
 PATCH against rev 755: remove superfluous asserts
 
 fixed, no idea why asserts where placed in there.
 unsigned shifting of 8 ^ 16 bit values seems perfectly reasonable.
The problem is that the code there gives different results to what happens in all other situations. See bug 2809. As far as I can tell, >>> is a broken concept. Andrei and I tried to get it removed from the language before publication of TDPL, but we failed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 15 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4837


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|x86_64                      |x86



---
Mass migration of bugs marked as x86-64 to just x86.  The platform run on isn't
what's relevant, it's if the app is a 32 or 64 bit app.

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


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



12:58:43 PDT ---
https://github.com/D-Programming-Language/dmd/commit/4fa620ba567bdf1c9be09d46d089a9fc364cc9d2

https://github.com/D-Programming-Language/dmd/commit/8f24469bd1cc3b6b33fd539ccf9d8dab3135156f

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 24 2011