]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: add in change missed from code review
authorThan McIntosh <thanm@google.com>
Wed, 23 Oct 2019 15:04:16 +0000 (11:04 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 24 Oct 2019 00:53:39 +0000 (00:53 +0000)
Incorporate a change suggested by Cherry for CL 201721 that I missed
accidentally.

Change-Id: I65e6532e78888505573169e56bc4ace9a0f8c510
Reviewed-on: https://go-review.googlesource.com/c/go/+/202760
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/loader/loader.go

index 3f5ec829a067ee385323045ba0ff3fbee398684e..3f61726b2450b7c85289449a41923aebe572fccd 100644 (file)
@@ -459,7 +459,7 @@ func (relocs *Relocs) At(j int) Reloc {
 // larger slice will be allocated. Final slice is returned.
 func (relocs *Relocs) ReadAll(dst []Reloc) []Reloc {
        if relocs.Count == 0 {
-               return dst
+               return dst[:0]
        }
 
        if cap(dst) < relocs.Count {