www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7990] New: Assertion failure in std.variant

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

           Summary: Assertion failure in std.variant
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: robert octarineparrot.com



18:54:21 BST ---
The following code:
----
module test;
import std.variant;
import std.stdio;
void main(string[] args)
{
    auto i = Variant(3);
    if (i < "4")
        writefln("true");
}
----

Results in the following assertion failure when using dmd 2.059:

$ rdmd test.d
core.exception.AssertError std.variant(788): Assertion failure
----------------
5   test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106d15536 _d_assertm + 42
6   test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106d22ae3 void
std.variant.__assert(int) + 23
7   test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106d032c9 int
std.variant.VariantN!(32uL).VariantN.opCmp!(immutable(char)[]).opCmp(immutable(char)[])
+ 225
8   test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106cfde2c _Dmain + 64
9   test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106d15ea9 extern (C) int
rt.dmain2.main(int, char**).void runMain() + 29
10  test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106d1585e extern (C) int
rt.dmain2.main(int, char**).void tryExec(scope void delegate()) + 38
11  test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106d15ef6 extern (C) int
rt.dmain2.main(int, char**).void runAll() + 58
12  test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106d1585e extern (C) int
rt.dmain2.main(int, char**).void tryExec(scope void delegate()) + 38
13  test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106d157e9 main + 237
14  test.d.42E9FB02844A66B138F2739733903C5F 0x0000000106cfdde4 start + 52
15  ???                                 0x0000000000000001 0x0 + 1
----------------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 26 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7990




Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/0d05bfb615bb20a83e5e6c0edce41009c350a6a0
Fix Variant comparison ops (fixes issue 7990).

Note that ptrdiff_t.min is used as a sentinel value in opCmp;
seems like this was an oversight during the 64 bit mass migration
in 8331c709.

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


Alex Rønne Petersen <alex lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alex lycus.org
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 17 2012