Skip to content

Allow helper function#1

Open
tequdev wants to merge 10 commits intomainfrom
allow-helper-function
Open

Allow helper function#1
tequdev wants to merge 10 commits intomainfrom
allow-helper-function

Conversation

@tequdev
Copy link
Owner

@tequdev tequdev commented Jan 16, 2026

Prevent deletion of non-hook/cbak functions and enable helper calls

Stop deleting functions other than hook/cbak to allow calls from hook/cbak (or other helpers).
This eliminates the need to inline helper functions during development and enables flexible hook coding.

Guard rewrite was corrupting function bodies by mixing input-buffer pointers with output-buffer edits.
Track output offsets for i32.const and call, and perform guard move/insert using memmove on the output buffer.
Stop mutating the input buffer during rewriting.
  Replace leb_out with leb_out_pad to maintain the original LEB128
  encoding size when remapping function indices in call instructions.
  This minimizes binary differences with the mainline output.
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.

1 participant