diff options
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/elf/file.go | 2 | ||||
| -rw-r--r-- | src/debug/macho/fat.go | 2 | ||||
| -rw-r--r-- | src/debug/macho/file.go | 4 | ||||
| -rw-r--r-- | src/debug/pe/symbol.go | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/debug/elf/file.go b/src/debug/elf/file.go index 9416ddaefb..87773541f0 100644 --- a/src/debug/elf/file.go +++ b/src/debug/elf/file.go @@ -498,7 +498,7 @@ func NewFile(r io.ReaderAt) (*File, error) { } // Read section headers - c := saferio.SliceCap((*Section)(nil), uint64(shnum)) + c := saferio.SliceCap[Section](uint64(shnum)) if c < 0 { return nil, &FormatError{0, "too many sections", shnum} } diff --git a/src/debug/macho/fat.go b/src/debug/macho/fat.go index 679cefb313..cc2134626f 100644 --- a/src/debug/macho/fat.go +++ b/src/debug/macho/fat.go @@ -86,7 +86,7 @@ func NewFatFile(r io.ReaderAt) (*FatFile, error) { // Following the fat_header comes narch fat_arch structs that index // Mach-O images further in the file. - c := saferio.SliceCap((*FatArch)(nil), uint64(narch)) + c := saferio.SliceCap[FatArch](uint64(narch)) if c < 0 { return nil, &FormatError{offset, "too many images", nil} } diff --git a/src/debug/macho/file.go b/src/debug/macho/file.go index 7cba3398fb..74a4da4da6 100644 --- a/src/debug/macho/file.go +++ b/src/debug/macho/file.go @@ -263,7 +263,7 @@ func NewFile(r io.ReaderAt) (*File, error) { if err != nil { return nil, err } - c := saferio.SliceCap((*Load)(nil), uint64(f.Ncmd)) + c := saferio.SliceCap[Load](uint64(f.Ncmd)) if c < 0 { return nil, &FormatError{offset, "too many load commands", nil} } @@ -472,7 +472,7 @@ func NewFile(r io.ReaderAt) (*File, error) { func (f *File) parseSymtab(symdat, strtab, cmddat []byte, hdr *SymtabCmd, offset int64) (*Symtab, error) { bo := f.ByteOrder - c := saferio.SliceCap((*Symbol)(nil), uint64(hdr.Nsyms)) + c := saferio.SliceCap[Symbol](uint64(hdr.Nsyms)) if c < 0 { return nil, &FormatError{offset, "too many symbols", nil} } diff --git a/src/debug/pe/symbol.go b/src/debug/pe/symbol.go index c33a4fc875..2e03af76bd 100644 --- a/src/debug/pe/symbol.go +++ b/src/debug/pe/symbol.go @@ -59,7 +59,7 @@ func readCOFFSymbols(fh *FileHeader, r io.ReadSeeker) ([]COFFSymbol, error) { if err != nil { return nil, fmt.Errorf("fail to seek to symbol table: %v", err) } - c := saferio.SliceCap((*COFFSymbol)(nil), uint64(fh.NumberOfSymbols)) + c := saferio.SliceCap[COFFSymbol](uint64(fh.NumberOfSymbols)) if c < 0 { return nil, errors.New("too many symbols; file may be corrupt") } |
