Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add function index for script.json (WASM) #725

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

i-saint
Copy link

@i-saint i-saint commented May 21, 2023

It seems you already know this, but in WASM the address of a function is actually the index of its reference table. However, this can be confusing if you're not familiar with the WASM specifications. This PR aims to make it easy by adding a function index to the script.json.
For instance, a function with index 123 will be $func123 at runtime.

@IamSanjid
Copy link

Hi, this is actually what I was looking for months, I didn't know those method addresses were reference indecies of the elem segment, is there any documnet I can find about why/how unity decides that these functions would be referenced inside of the elem segment? TBH this actually makes sense if you think how the javascript calls sense function sheesh never thought about it thanks.

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.

None yet

2 participants