-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime error: Index out of range #6
Comments
GetFunc‘s principle is to traverse the symbol table.The get func has the bug, the ftab.funcoff maybe bigger than pclntable if int(ftab.funcoff) >= len(moduleData.pclntable) {
continue
} whole func: func FindFuncWithName(name string) (uintptr, error) {
for moduleData := &Firstmoduledata; moduleData != nil; moduleData = moduleData.next {
for _, ftab := range moduleData.ftab {
if int(ftab.funcoff) >= len(moduleData.pclntable) {
continue
}
f := (*runtime.Func)(unsafe.Pointer(&moduleData.pclntable[ftab.funcoff]))
if f.Name() == name {
return f.Entry(), nil
}
}
}
return 0, fmt.Errorf("Invalid function name: %s", name)
} |
I met the same problem, but my confusion is that how the ftab.funcoff could bigger than pclntable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm getting the following error when trying to run a package that uses go-forceexport. Here is the error log -
System Details:
Go 1.13.10 on Linux for IBM Z/s390x
The text was updated successfully, but these errors were encountered: