second-state / WasmEdge-go

The GO language SDK and API for WasmEdge
https://www.secondstate.io/articles/extend-golang-app-with-webassembly-rust/
Apache License 2.0
107 stars 16 forks source link

externRefManager/hostFunctionManager does NOT handle reuse elements properly #11

Closed chenhengqi closed 3 years ago

chenhengqi commented 3 years ago

This implementation here seems to be wrong ?

https://github.com/second-state/WasmEdge-go/blob/87a58325196d611e296780f43de2abd8b0804d41/wasmedge/value.go#L91-L93

https://github.com/second-state/WasmEdge-go/blob/87a58325196d611e296780f43de2abd8b0804d41/wasmedge/hostfunc.go#L42-L44

The last element is reused, but not pop out from the slice.

hydai commented 3 years ago

Thanks for reporting.

@q82419 could you please check this?

q82419 commented 3 years ago

Thanks for reporting. Will be fixed in PR.