www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17619] New: [REG2.072] Wrong debug line information with

https://issues.dlang.org/show_bug.cgi?id=17619

          Issue ID: 17619
           Summary: [REG2.072] Wrong debug line information with single
                    line loops
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: mk krej.cz

void main()
{
    foreach (i; 0 .. 3)
        i++;

    int bad; // shown during loop
}

Breakpoint 1, D main () at loop3.d:3
3               foreach (i; 0 .. 3)
(gdb) n
4                   i++;
(gdb)
6               int bad; // shown during loop
(gdb)
4                   i++;
(gdb)
6               int bad; // shown during loop
(gdb)
4                   i++;
(gdb)
6               int bad; // shown during loop
(gdb)
6               int bad; // shown during loop
(gdb)
7       }

When compiled with older DMD:

Breakpoint 1, D main () at loop3.d:3
3               foreach (i; 0 .. 3)
(gdb) n
4                   i++;
(gdb)
3               foreach (i; 0 .. 3)
(gdb)
4                   i++;
(gdb)
3               foreach (i; 0 .. 3)
(gdb)
4                   i++;
(gdb)
3               foreach (i; 0 .. 3)
(gdb)
6               int bad; // shown during loop
(gdb)
7       }

Introduced by https://github.com/dlang/dmd/pull/2867

--
Jul 07