Skip to content

Conversation

@sifislag
Copy link
Collaborator

In optimized contracts, public functions with the same implementation can sometimes get merged. Gigahorse used to just infer the one, and this pr fixes it:

  • We attempt to clone a public function entry block that is shared between different methods.
  • If this entry block is a JUMPI block (very often), we transform it to a JUMP block by adding a direct jump in the middle of it, and breaking it up to two blocks. This way the cloner can work.

@github-actions
Copy link

Test Results (Souffle 2.3)

62 tests  +1   62 ✅ +1   48m 41s ⏱️ +24s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 482ddb3. ± Comparison against base commit fbc34bf.

@github-actions
Copy link

Test Results (Souffle 2.4)

62 tests  +1   62 ✅ +1   54m 27s ⏱️ + 6m 7s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 482ddb3. ± Comparison against base commit fbc34bf.

@sifislag sifislag merged commit 224dfad into master Oct 16, 2025
5 checks passed
@sifislag sifislag deleted the shared_public_function branch October 16, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants