Skip to content
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

interp: recover in Eval and EvalPath #1560

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Commits on Oct 8, 2023

  1. interp: recover in Eval and EvalPath

    Now Eval() and EvalPath() recover from internal panic and
    return it as error with call stacks.
    
    This fixes the case where user code calls os.Exit(1), which is
    converted to panic() and breaks down the program.
    Bai-Yingjie committed Oct 8, 2023
    Configuration menu
    Copy the full SHA
    48f8875 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2024

  1. fix: do not panic when assigning to _ (blank) var.

    Fix interp.isEmptyInterface to tolerate a nil type.
    
    Fixes traefik#1619
    mvertes authored and Bai-Yingjie committed Jul 13, 2024
    Configuration menu
    Copy the full SHA
    3f6b949 View commit details
    Browse the repository at this point in the history
  2. fix: avoid memory leak in closure

    Simplify frame management. Remove node dependency on frame pointer.
    
    Fixes traefik#1618
    mvertes authored and Bai-Yingjie committed Jul 13, 2024
    Configuration menu
    Copy the full SHA
    d9d2d61 View commit details
    Browse the repository at this point in the history
  3. fix: don't panic in map range if assigned value is _

    Ensure that the code generated for `for s, _ = range ...` is the same as `for s = range ...`.
    
    Fixes traefik#1622.
    mvertes authored and Bai-Yingjie committed Jul 13, 2024
    Configuration menu
    Copy the full SHA
    8e18c46 View commit details
    Browse the repository at this point in the history
  4. interp: allow assignment to exported variables

    If you `(*interp.Interpreter).Use` a variable, you should be able to assign to it.
    
    Fixes traefik#1623
    theclapp authored and Bai-Yingjie committed Jul 13, 2024
    Configuration menu
    Copy the full SHA
    9ed60ff View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2024

  1. Configuration menu
    Copy the full SHA
    86d4fa1 View commit details
    Browse the repository at this point in the history
  2. interp: fix mismatch assign statement panic

    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
    chikaku authored and Bai-Yingjie committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    bf5850f View commit details
    Browse the repository at this point in the history
  3. fix for issue traefik#1634 -- for passing a closure to exported Go fu…

    …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() ..
    rcoreilly authored and Bai-Yingjie committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    3efbf2b View commit details
    Browse the repository at this point in the history
  4. automatic loop variables in for loops ("loop var"), consistent with g…

    …o 1.22 behavior
    
    This builds on traefik#1644 and adds automatic per-loop variables that are consistent with go 1.22 behavior.  See traefik#1643 for discussion.
    
    This is still a draft because the for7 version ends up capturing the per-loop var values when they are +1 relative to what they should be.  Maybe somehow the incrementing and conditional code is somehow capturing the within loop variables and incrementing them?  not sure how that would work.  anyway, need to investigate further before this is ready to go, but pushing it here in case there are other issues or someone might figure out this bug before I do..
    rcoreilly authored and Bai-Yingjie committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    40a459c View commit details
    Browse the repository at this point in the history
  5. interp: fix a missing implicit type conversion for binary expression

    When parsing binary operator expressions, make sure that implicit type conversions for untyped expressions are performed. It involves walking the sub-expression subtree at post-processing of binary expressions.
    
    Fixes traefik#1653.
    mvertes authored and Bai-Yingjie committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    ee47504 View commit details
    Browse the repository at this point in the history