[Issue 9506] When using alias this, writeln modifies its argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 30 07:19:07 PDT 2013


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


Maxim Fomin <maxim at maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim at maxim-fomin.ru
          Component|DMD                         |Phobos
         OS/Version|Mac OS X                    |All


--- Comment #6 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-06-30 07:19:06 PDT ---
Can reproduce on linux. I haven't found any codegen bug, but value
modification.

Old value = 2 //length of array
New value = 1
0x000000000043a3e6 in std.array.__T8popFrontTkZ.popFront() (a=0x7ffff7ed8ff0)
    at /usr/include/d/dmd/phobos/std/array.d:451
451        a = a[1 .. $];
(gdb) bt
#0  0x000000000043a3e6 in std.array.__T8popFrontTkZ.popFront() (
    a=0x7ffff7ed8ff0) at /usr/include/d/dmd/phobos/std/array.d:451
#1  0x000000000043af8c in
std.format.__T11formatRangeTS3std5stdio4File17LockingTextWriterTC4main4testTaZ.formatRange()
(f=<error reading variable>, 
    val=0x7fffffffd808, w=0x7fffffffd820)
    at /usr/include/d/dmd/phobos/std/format.d:2155
#2  0x000000000043a312 in
std.format.__T11formatValueTS3std5stdio4File17LockingTextWriterTC4main4testTaZ.formatValue()
(f=<error reading variable>, 
    val=0x7ffff7ed8fe0, w=...) at /usr/include/d/dmd/phobos/std/format.d:2572
#3  0x000000000043a256 in
std.format.__T13formatGenericTS3std5stdio4File17LockingTextWriterTC4main4testTaZ.formatGeneric()
(f=<error reading variable>, 
    arg=0x7fffffffda60, w=...) at /usr/include/d/dmd/phobos/std/format.d:2996
#4  0x000000000043a13a in
std.format.__T14formattedWriteTS3std5stdio4File17LockingTextWriterTaTC4main4testZ.formattedWrite()
(_param_2=0x7ffff7ed8fe0, 
    fmt=..., w=...) at /usr/include/d/dmd/phobos/std/format.d:506
#5  0x0000000000439c58 in std.stdio.File.__T5writeTC4main4testTaZ.write() (
    this=0x695f80 <std.stdio.stdout()>, _param_1=10 '\n', 
    _param_0=0x7ffff7ed8fe0) at /usr/include/d/dmd/phobos/std/stdio.d:744
#6  0x0000000000439baa in std.stdio.__T7writelnTC4main4testZ.writeln() (
    _param_0=0x7ffff7ed8fe0) at /usr/include/d/dmd/phobos/std/stdio.d:1746
#7  0x0000000000437c3d in D main () at main.d:24 //file was modified

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