Stream: git-wasmtime

Topic: wasmtime / PR #3582 Fix issues with the C API vector impl...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 03 2021 at 00:29):

Amanieu edited PR #3582 from c-api-vec to main:

While working on https://github.com/wasmerio/wasmer/pull/2683 I noticed a few bugs in wasmtime's implementation of the Wasm C API, specifically the vector types.

The first issue is the incorrect implementation of Clone using #[derive]. This only performs a shallow copy of the vector, which means that you can end up with a double-free once both clones are freed.

The second issue is that the wasm_*_vec_new functions are supposed to take ownership of objects in the given slice, not clone them. This is apparent if you look at the declaration and how it is used in the C API header.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 03 2021 at 20:59):

peterhuene submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 03 2021 at 23:57):

Amanieu updated PR #3582 from c-api-vec to main.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2021 at 01:44):

peterhuene merged PR #3582.


Last updated: Dec 23 2024 at 12:05 UTC