{"record":{"id":"bd516de6dfb91e03","repo":"wasmerio/wasmer","slug":"copying-tables-is-currently-not-implemented","errorCode":null,"errorMessage":"Copying tables is currently not implemented!","messagePattern":"Copying tables is currently not implemented!","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/api/src/backend/v8/entities/table.rs","lineNumber":190,"sourceCode":"                }\n            };\n            if !wasm_table_grow(self.handle, delta, init) {\n                return Err(RuntimeError::new(\"Could not grow table\"));\n            }\n\n            Ok(size)\n        }\n    }\n\n    pub fn copy(\n        _store: &mut impl AsStoreMut,\n        _dst_table: &Self,\n        _dst_index: u32,\n        _src_table: &Self,\n        _src_index: u32,\n        _len: u32,\n    ) -> Result<(), RuntimeError> {\n        unimplemented!(\"Copying tables is currently not implemented!\")\n    }\n\n    pub(crate) fn from_vm_extern(store: &mut impl AsStoreMut, vm_extern: VMExternTable) -> Self {\n        check_isolate(store);\n        let store_mut = store.as_store_mut();\n\n        Self {\n            handle: vm_extern.unwrap_v_8(),\n        }\n    }\n\n    pub fn is_from_store(&self, store: &impl AsStoreRef) -> bool {\n        check_isolate(store);\n        true\n    }\n}\n\nimpl crate::Table {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/api/src/backend/v8/entities/table.rs#L172-L208","documentation":"Table::copy (element segment-style copying between tables, like the table.copy instruction) is not implemented for the v8/wasm_c_api backend; the method unconditionally panics instead of performing the copy.","triggerScenarios":"Calling Table::copy(dst_store, dst_table, dst_index, src_table, src_index, len) with the v8 backend; instantiating modules that rely on host-driven table copies; some bulk-memory operations routed through this API.","commonSituations":"Dynamic linking schemes and module instrumentation that copy function tables; tests written against the sys backend being run under v8.","solutions":["Switch to a backend that implements Table::copy (sys/LLVM)","Copy elements manually: read each element with Table::get and write with Table::set in a loop","Avoid table.copy-dependent modules on this backend","Implement Table::copy for this backend upstream"],"exampleFix":"// before\nTable::copy(&mut store, &dst_table, 0, &src_table, 0, len)?;\n// after\nfor i in 0..len {\n    let item = src_table.get(&store, src_index + i).unwrap();\n    dst_table.set(&mut store, dst_index + i, item)?;\n}","handlingStrategy":"validation","validationCode":"fn table_copy_supported(engine: &Engine) -> bool {\n    !matches!(engine.target_backend(), Backend::WasmCApi | Backend::V8)\n}\n","typeGuard":null,"tryCatchPattern":"let res = std::panic::catch_unwind(|| Table::copy(&mut store, &dst, 0, &src, 0, len));\nif res.is_err() { copy_tables_via_get_set(&mut store, &src, &dst)?; }","preventionTips":["Check module usage of table.copy / bulk-memory before choosing the v8 backend","Implement a get/set-based copy fallback in shared utilities","Pin the sys backend for dynamic-linking workloads"],"tags":["wasm","table","unimplemented","v8","bulk-memory"],"backgroundTag":"table-copy-unimplemented","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}