risor-io / risor

Fast and flexible scripting for Go developers and DevOps.
https://risor.io
Apache License 2.0
576 stars 24 forks source link

fix stack pollution with defers #234

Closed myzie closed 2 months ago

myzie commented 2 months ago

A successful deferred function call pushes the result onto the VM stack. This was not being popped off before, which causes a problem when the deferred is executing within a loop and probably other situations too. We just need to pop this value to ignore it.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 32.09%. Comparing base (6a363bc) to head (a704131).

Files Patch % Lines
vm/vm.go 50.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #234 +/- ## ======================================= Coverage 32.09% 32.09% ======================================= Files 121 121 Lines 15122 15124 +2 ======================================= + Hits 4853 4854 +1 Misses 9680 9680 - Partials 589 590 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.