aboutsummaryrefslogtreecommitdiff
path: root/src/debug/macho
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug/macho')
-rw-r--r--src/debug/macho/file.go5
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