mirror of
https://github.com/thunderbrewhq/binana.git
synced 2025-12-12 09:52:28 +00:00
feat(go): go tool will error now when there are multiple symbols associated with an address
This commit is contained in:
parent
da8d47619c
commit
df7df2ff25
1 changed files with 5 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package symfile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
"sort"
|
||||
)
|
||||
|
|
@ -16,6 +17,10 @@ func (t *InMemoryTable) Insert(entry *Entry) (err error) {
|
|||
})
|
||||
|
||||
if i < len(t.Entries) {
|
||||
if t.Entries[i].StartAddress == entry.StartAddress {
|
||||
err = fmt.Errorf("symfile: (*InMemoryTable).Insert() failed: duplicate entry: %s", entry.Name)
|
||||
return
|
||||
}
|
||||
t.Entries = slices.Insert(t.Entries, i, *entry)
|
||||
} else {
|
||||
t.Entries = append(t.Entries, *entry)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue