diff --git a/internal/dwarf/dwarf.go b/internal/dwarf/dwarf.go index 54b3eb0158..ab8da82585 100644 --- a/internal/dwarf/dwarf.go +++ b/internal/dwarf/dwarf.go @@ -84,6 +84,16 @@ func SizeForDWARFVar( return nil, uint64(typ.Size()), nil } +var boolIgnores = [...]dwarf.Attr{ + dwarf.AttrCallAllCalls, + dwarf.AttrCallAllTailCalls, +} + +var ignores = [...]dwarf.Attr{ + dwarf.AttrAbstractOrigin, + dwarf.AttrSpecification, +} + func EntryShouldIgnore(entry *dwarf.Entry) bool { declaration := entry.Val(dwarf.AttrDeclaration) if declaration != nil { @@ -99,11 +109,6 @@ func EntryShouldIgnore(entry *dwarf.Entry) bool { } } - boolIgnores := []dwarf.Attr{ - dwarf.AttrCallAllCalls, - dwarf.AttrCallAllTailCalls, - } - for _, ignore := range boolIgnores { valAny := entry.Val(ignore) if valAny != nil { @@ -118,11 +123,6 @@ func EntryShouldIgnore(entry *dwarf.Entry) bool { } } - ignores := []dwarf.Attr{ - dwarf.AttrAbstractOrigin, - dwarf.AttrSpecification, - } - for _, ignore := range ignores { if entry.Val(ignore) != nil { return true diff --git a/internal/knowninfo/disasm.go b/internal/knowninfo/disasm.go index 160934c441..6021dee2e7 100644 --- a/internal/knowninfo/disasm.go +++ b/internal/knowninfo/disasm.go @@ -57,7 +57,7 @@ func (k *KnownInfo) Disasm() error { ) for fn := range k.Deps.Functions { - if err := sem.Acquire(resultProcess, 1); err != nil { + if err = sem.Acquire(resultProcess, 1); err != nil { slog.Error(fmt.Sprintf("Failed to acquire semaphore: %v", err)) break }