diff options
Diffstat (limited to 'src/debug/macho/file.go')
| -rw-r--r-- | src/debug/macho/file.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/debug/macho/file.go b/src/debug/macho/file.go index 7b11bb2954..3298771619 100644 --- a/src/debug/macho/file.go +++ b/src/debug/macho/file.go @@ -707,8 +707,9 @@ func (f *File) ImportedSymbols() ([]string, error) { st := f.Symtab dt := f.Dysymtab - var all []string - for _, s := range st.Syms[dt.Iundefsym : dt.Iundefsym+dt.Nundefsym] { + symbols := st.Syms[dt.Iundefsym : dt.Iundefsym+dt.Nundefsym] + all := make([]string, 0, len(symbols)) + for _, s := range symbols { all = append(all, s.Name) } return all, nil |
