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
"index out of range [3] with length 3" when app import "ethereum/go-ethereum/rpc" #524
Comments
I found out that this error start at go-ethereum v1.10.4. |
Thanks for reporting! This is because of variadic functions, where the number of arguments may not match the number of parameters. I'm working on a fix. |
mvdan
added a commit
to mvdan/garble-fork
that referenced
this issue
Apr 22, 2022
When a function definition is variadic, the number of parameters may not match the number of calling arguments. Our existing code was a bit naive with this edge case, leading to a panic when indexing call.Args. Keep track of that information, and properly handle all variadic arguments that may be used indirectly with reflection. We add a test case that used to panic, where 0 arguments are used for a variadic parameter, as well as a case where we need to disable obfuscation for a Go type used as the second variadic argument rather than the first. Finally, the old code in findReflectFunctions looked at Go function types from the point of view of go/ast.FuncType. Use go/types.Signature instead, where we don't need to deal with the grouping of variables in the original syntax, and which is more consistent with the rest of the garble codebase. Fixes burrowers#524.
lu4p
pushed a commit
that referenced
this issue
Apr 22, 2022
When a function definition is variadic, the number of parameters may not match the number of calling arguments. Our existing code was a bit naive with this edge case, leading to a panic when indexing call.Args. Keep track of that information, and properly handle all variadic arguments that may be used indirectly with reflection. We add a test case that used to panic, where 0 arguments are used for a variadic parameter, as well as a case where we need to disable obfuscation for a Go type used as the second variadic argument rather than the first. Finally, the old code in findReflectFunctions looked at Go function types from the point of view of go/ast.FuncType. Use go/types.Signature instead, where we don't need to deal with the grouping of variables in the original syntax, and which is more consistent with the rest of the garble codebase. Fixes #524.
Wow! That is really fast! Thanks for your hard working! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Garble and Go are you using?
What environment are you running Garble on?
go env
OutputWhat did you do?
What did you expect to see?
Successfully build the application
What did you see instead?
The text was updated successfully, but these errors were encountered: