From c96e3ce097b1774e608ef10816dff9b85059c29f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 1 May 2019 12:13:12 -0700 Subject: [PATCH] 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. --- src/anyref.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/anyref.rs b/src/anyref.rs index 0cd94afe..560233ff 100644 --- a/src/anyref.rs +++ b/src/anyref.rs @@ -201,7 +201,7 @@ pub extern fn __wbindgen_anyref_table_dealloc(idx: usize) { #[no_mangle] pub unsafe extern fn __wbindgen_drop_anyref_slice(ptr: *mut JsValue, len: usize) { for slot in slice::from_raw_parts_mut(ptr, len) { - ptr::drop_in_place(slot); + __wbindgen_anyref_table_dealloc(slot.idx as usize); } }