Skip to content

Commit c96e3ce

Browse files
committed
Fix __wbindgen_object_drop_ref unnecessary bindings
This commit fixes an issue where bindings for `__wbindgen_object_drop_ref` are generated even if the function isn't actually used by the final wasm file. This is currently due to the fact that we run gc passes pretty late in wasm-bindgen and one of the intrinsics that ended up getting gc'd referenced the `__wbindgen_object_drop_ref` intrinsic function. The fix here is somewhat naive by just updating the intrinsic to not actually use `__wbindgen_object_drop_ref`. This may not be a long-term solution but it should be good enough for now at least.
1 parent c127ef7 commit c96e3ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/anyref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub extern fn __wbindgen_anyref_table_dealloc(idx: usize) {
201201
#[no_mangle]
202202
pub unsafe extern fn __wbindgen_drop_anyref_slice(ptr: *mut JsValue, len: usize) {
203203
for slot in slice::from_raw_parts_mut(ptr, len) {
204-
ptr::drop_in_place(slot);
204+
__wbindgen_anyref_table_dealloc(slot.idx as usize);
205205
}
206206
}
207207

0 commit comments

Comments
 (0)