-
-
Notifications
You must be signed in to change notification settings - Fork 2
Stack #1
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
Stack #1
Conversation
By placing a handle value on several strategic calls in the runtime we can then later parse a runtime stacktrace, look for the magic values in function parameters, and reconstruct the calling nodes. We can use that to filter out all the yaegi runtime calls and present the user with a stacktrace that includes only interpreted frames.
this makes the filtered stack look identical to the regular go stacktrace
this allows calling code to interchange both types
interpreter may be entered (for example) from genFunctionWrapper
When a panic happens, we want to get the stack trace from the oldest panic, before runCfg unwinds everything. However, at that point we don't know yet whether we will be recovered. As a silly kludge, currently storing the oldest panic in a list on the Interpreter struct which can then be queried once we're ready. The approach taken is not strictly correct: if a panic is recovered, and never queried, and later the same error occurs again and then is not recovered, the wrong call stack will be returned.
… conversion nil guard
…ic_test.go with additional test cases. hopefully that's the end of it..
… wrappers A side effect of traefik#1281 is that it added unnecessary additional newlines in generated interface wrappers from the `extract` tool. This PR removes those newlines from the extract tool template and updates the generated code with that change.
Follow by the [Spec](https://go.dev/ref/spec#Assignment_statements): The number of operands on the left hand side must match the number of values. For instance, if f is a function returning two values `x, y = f()` assigns the first value to x and the second to y. In the second form, the number of operands on the left must equal the number of expressions on the right, each of which must be single-valued, and the nth expression on the right is assigned to the nth operand on the left. Fixes traefik#1606
…nction This fixes issue traefik#1634 includes special case for defer function. I could remove or significantly reduce the comment description, and just have that here for future reference: // per traefik#1634, if v is already a func, then don't re-wrap! critically, the original wrapping // clones the frame, whereas the one here (below) does _not_ clone the frame, so it doesn't // generate the proper closure capture effects! // this path is the same as genValueAsFunctionWrapper which is the path taken above if // the value has an associated node, which happens when you do f := func() ..
Generic func
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for filing this. Please see my comment.
@@ -1,5 +1,5 @@ | |||
package c2 | |||
|
|||
import "github.com/cogentcore/yaegi/_test/c1" | |||
import "github.com/traefik/yaegi/_test/c1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff is cluttered because of a change in the URL. If you could find-and-replace github.com/traefik/yaegi with github.com/cogentcore/yaegi, that would be great!
I didn't mean to file this PR, must have been a miss click in github. I love the work that y'all are doing with this project, and I would love to have your changes merged into traefik's repo! |
No description provided.