{"record":{"id":"062d292a1b92c669","repo":"wasmerio/wasmer","slug":"dynamic-functions-cannot-be-used-in-tables-or-as-f","errorCode":null,"errorMessage":"dynamic functions cannot be used in tables or as funcrefs","messagePattern":"dynamic functions cannot be used in tables or as funcrefs","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/api/src/backend/sys/entities/function/mod.rs","lineNumber":648,"sourceCode":"        params: Vec<RawValue>,\n    ) -> Result<Box<[Value]>, RuntimeError> {\n        let trampoline = unsafe {\n            self.handle\n                .get(store.objects_mut().as_sys())\n                .anyfunc\n                .as_ptr()\n                .as_ref()\n                .call_trampoline\n        };\n        let mut results = vec![Value::null(); self.result_arity(store)];\n        self.call_wasm_raw(store, trampoline, params, &mut results)?;\n        Ok(results.into_boxed_slice())\n    }\n\n    pub(crate) fn vm_funcref(&self, store: &impl AsStoreRef) -> VMFuncRef {\n        let vm_function = self.handle.get(store.as_store_ref().objects().as_sys());\n        if vm_function.kind == VMFunctionKind::Dynamic {\n            panic!(\"dynamic functions cannot be used in tables or as funcrefs\");\n        }\n        VMFuncRef(vm_function.anyfunc.as_ptr())\n    }\n\n    pub(crate) unsafe fn from_vm_funcref(store: &mut impl AsStoreMut, funcref: VMFuncRef) -> Self {\n        let signature = {\n            let anyfunc = unsafe { funcref.0.as_ref() };\n            store\n                .as_store_mut()\n                .engine()\n                .as_sys()\n                .lookup_signature(anyfunc.type_signature_hash)\n                .expect(\"Signature not found in store\")\n        };\n        let vm_function = VMFunction {\n            anyfunc: MaybeInstanceOwned::Instance(funcref.0),\n            signature,\n            // All functions in tables are already Static (as dynamic functions","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/api/src/backend/sys/entities/function/mod.rs#L630-L666","documentation":"Error \"dynamic functions cannot be used in tables or as funcrefs\" thrown in wasmerio/wasmer.","triggerScenarios":"Thrown at lib/api/src/backend/sys/entities/function/mod.rs:648 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}