Skip to content

lang: Remove the fallback function shortcut in try_entry function#3109

Merged
acheroncrypto merged 6 commits into
otter-sec:masterfrom
acheroncrypto:lang-remove-the-fallback-function-shortcut-in-try-entry-function
Jul 24, 2024
Merged

lang: Remove the fallback function shortcut in try_entry function#3109
acheroncrypto merged 6 commits into
otter-sec:masterfrom
acheroncrypto:lang-remove-the-fallback-function-shortcut-in-try-entry-function

Conversation

@acheroncrypto

Copy link
Copy Markdown
Collaborator

Problem

try_entry function returns early if the instruction data is less than 8 bytes:

https://github.com/coral-xyz/anchor/blob/ccac42dfcf8d42cb156f05689906e9b48394d58a/lang/syn/src/codegen/program/entry.rs#L65-L67

Summary of changes

  • Remove the fallback function shortcut in try_entry function
  • Remove gen_fallback function and inline where the fallback is being used (since this is the only place it's being used)
  • Remove generate_event_cpi_handler function and inline it to make it consistent with the above change

Note: This PR is part of a greater effort explained in #3097.

@vercel

vercel Bot commented Jul 23, 2024

Copy link
Copy Markdown

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto merged commit c06ec44 into otter-sec:master Jul 24, 2024
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant