]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: writelines should keep is_stmt in sync with what it's writing
authorAlessandro Arzilli <alessandro.arzilli@gmail.com>
Sun, 13 May 2018 13:17:40 +0000 (15:17 +0200)
committerDavid Chase <drchase@google.com>
Sun, 13 May 2018 20:09:56 +0000 (20:09 +0000)
For all functions but the last one if the function ends on a
non-statement instruction the statement flag in debug_line is changed
but is_stmt is not updated to match.

Change-Id: I03c275c5e261ea672ce4da7baca2458810708326
Reviewed-on: https://go-review.googlesource.com/112979
Reviewed-by: David Chase <drchase@google.com>
src/cmd/link/internal/ld/dwarf.go

index 6232ab6e2fd2074cadc321559dbbf20d44b98f59..9a75ad96f16d2156282a466b8223f4d56b80a95c 100644 (file)
@@ -1302,6 +1302,7 @@ func writelines(ctxt *Link, lib *sym.Library, textp []*sym.Symbol, ls *sym.Symbo
                }
                if is_stmt == 0 && i < len(textp)-1 {
                        // If there is more than one function, ensure default value is established.
+                       is_stmt = 1
                        ls.AddUint8(uint8(dwarf.DW_LNS_negate_stmt))
                }
        }