vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.83k stars 789 forks source link

fix[venom]: fix branch eliminator cases in sccp #4003

Closed charles-cooper closed 3 months ago

charles-cooper commented 3 months ago

What I did

How I did it

How to verify it

Commit message

in sccp, when the operand of `jnz`, `djmp` or `assert` is already an
`IRLiteral` (this is most easily seen by disabling the IRnode branch
eliminator), the compiler will panic. this commit fixes the bug, and
refactor some commonly used code into helper functions.

Description for the changelog

Cute Animal Picture

![Put a link to a cute animal picture inside the parenthesis-->]()

charles-cooper commented 3 months ago

how about literals inside of assertions?

codecov-commenter commented 3 months ago

Codecov Report

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

Project coverage is 89.91%. Comparing base (93147be) to head (e39076a).

:exclamation: Current head e39076a differs from pull request most recent head b02e098. Consider uploading reports for the commit b02e098 to get more accurate results

Files Patch % Lines
vyper/venom/passes/sccp/sccp.py 96.29% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4003 +/- ## ========================================== - Coverage 90.78% 89.91% -0.87% ========================================== Files 105 103 -2 Lines 15248 14915 -333 Branches 3362 3303 -59 ========================================== - Hits 13843 13411 -432 - Misses 966 1053 +87 - Partials 439 451 +12 ```

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

charles-cooper commented 3 months ago

i'm going to revert the changes to exp eval and the CI pipelines in order to keep this PR more "pure". will open those in a separate PR