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

Is it possible to access un-exported data #401

Open
joesonw opened this issue Oct 23, 2023 · 0 comments
Open

Is it possible to access un-exported data #401

joesonw opened this issue Oct 23, 2023 · 0 comments
Labels
❓ question Further information is requested

Comments

@joesonw
Copy link
Contributor

joesonw commented Oct 23, 2023

Summary

I've compiled following code using tinygo

//go:wasmimport env call
func _call(ptr uint32)

//go:noinline
func call(f func()) {
	ptr := unsafe.Pointer(&f)
	_call(uint32(uintptr(ptr)))
}

and the resulted wasm will call my host function with value a pointer to a memory with two u32: 0 (receiver), 1 (index of function in the table), and the table is as following.

image

And the generated wasm does not export this table, is there any way I can access this function $main.main$1

Additional details

I've got it working with wazero, they exposed a function to retrieve unexported function defined in tables.

I am wondering if it's archievable in wasmer.

@joesonw joesonw added the ❓ question Further information is requested label Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant