]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld: fix PC deltas in DWARF line number table
authorIan Lance Taylor <iant@golang.org>
Tue, 10 Jun 2014 21:11:39 +0000 (14:11 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 10 Jun 2014 21:11:39 +0000 (14:11 -0700)
The putpclcdelta function set the DWARF line number PC to
s->value + pcline->pc, which is correct, but the code then set
the local variable pc to epc, which can be a different value.
This caused the next delta in the DWARF table to be wrong.

Fixes #8098.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/104950045

src/cmd/ld/dwarf.c

index cee591ffa63c24981bc4b33172d1831191099c9a..cc77b45cd6996b3251b79470fb7674906e5ce681 100644 (file)
@@ -1624,13 +1624,13 @@ writelines(void)
                        }
                        putpclcdelta(s->value + pcline.pc - pc, pcline.value - line);
 
-                       pc = epc;
+                       pc = s->value + pcline.pc;
+                       line = pcline.value;
                        if(pcfile.nextpc < pcline.nextpc)
                                epc = pcfile.nextpc;
                        else
                                epc = pcline.nextpc;
                        epc += s->value;
-                       line = pcline.value;
                }
 
                da = 0;