From 482b899327cda5324c55f93d8d713b02c29df74d Mon Sep 17 00:00:00 2001 From: blacktop Date: Tue, 23 Jul 2024 17:12:52 -0600 Subject: [PATCH] fix: handle no funcs found edge case --- file.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file.go b/file.go index b776a7b..45f4101 100644 --- a/file.go +++ b/file.go @@ -1975,6 +1975,9 @@ func (f *File) GenerateFunctionStarts() ([]types.Function, error) { }) } } + if len(funcs) == 0 { + return nil, fmt.Errorf("failed to find any function starts by searching for 'pacibsp' prologues") + } // set end addresses for i := 0; i < len(funcs)-1; i++ { funcs[i].EndAddr = funcs[i+1].StartAddr