www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10804] New: regression(2.063=>2.064) problem with Appender or dmd?

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

           Summary: regression(2.063=>2.064) problem with Appender or dmd?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thelastmammoth gmail.com



on 2.063, behavior is normal, but on 2.064 this passes: (see "weird" below) (on
v2.064-devel-75f7752)

string identity(string a){
  return a;
}
string fun(){
  import std.array;
  Appender!(string) ret;
  ret.put("identity(`Ω`)");
  return ret.data;
}

void main(){
  enum a1="identity(`Ω`)";
  enum a2=fun;
  assert(a1==a2);
  assert(mixin(a1)!=mixin(a2));//weird
  enum a1b=mixin(a1);
  enum a2b=mixin(a2);
  assert(cast(ubyte[])a1b == [206, 169]);
  assert(cast(ubyte[])a2b == [195, 142, 194, 169]);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 11 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10804


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code



This regression is caused by recent Appender change:
https://github.com/D-Programming-Language/phobos/commit/4da1639c98cb73d07858b17c2d225063889e4700
, but essentialy this is a dmd bug.

Reduced case:

string identity(string a) { return a; }
string fun()
{
    char[] s;
    s.length = 14;
    s[0 .. 14] = "identity(`Ω`)"[];
    return cast(string)s;
}

void main()
{
    enum a1 = "identity(`Ω`)";
    enum a2 = fun();    // fun() returns a string which originally mutable
array
    static assert(cast(ubyte[])mixin(a1) == [0xCE, 0xA9]);
    static assert(cast(ubyte[])mixin(a2) == [0xCE, 0xA9]);  // fails!
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10804


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/2473

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10804




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d6e9ea0fc6b906c829344806bb89c14d92bf48d7
fix Issue 10804 - regression(2.063=>2.064) problem with Appender or dmd?

https://github.com/D-Programming-Language/dmd/commit/28f2c8c6c4e82392ff4aa366cf872bef45ee4f75


[REG2.064a] Issue 10804 - problem with Appender or dmd?

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


Walter Bright <bugzilla digitalmars.com> changed:

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


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