hyperledger / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.22k stars 207 forks source link

Bugfix: Do not mangle overridden non-overloaded virtual function names #1624

Closed xermicus closed 4 months ago

xermicus commented 4 months ago

Closes #1623

The basic idea of the algorithm checking whether a function name is eligible for mangling or not is to mangle the name if that function is publicly callable but the functions name appears multiple time in the contract. But this doesn't account for virtual functions also appearing more than one time in the same contract if they are overridden. With this PR, we bail early if the function we are checking overrides, marking only the single one non-overriding implementation as eligible for mangling. Consequently, functions which override but do not overload are no longer unnecessarily mangled.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.57%. Comparing base (5cab937) to head (a9b7e02).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1624 +/- ## ========================================== - Coverage 88.58% 88.57% -0.01% ========================================== Files 150 150 Lines 69330 69330 ========================================== - Hits 61415 61412 -3 - Misses 7915 7918 +3 ```

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

xermicus commented 4 months ago

Codecov says -0.01% coverage on the project however the diff hit 100%. I'm gonna merge