MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / validate_symbol

Function validate_symbol

cranelift/object/src/backend.rs:295–304  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

293}
294
295fn validate_symbol(name: &str) -> ModuleResult<()> {
296 // null bytes are not allowed in symbol names and will cause the `object`
297 // crate to panic. Let's return a clean error instead.
298 if name.contains("\0") {
299 return Err(ModuleError::Backend(anyhow::anyhow!(
300 "Symbol {name:?} has a null byte, which is disallowed"
301 )));
302 }
303 Ok(())
304}
305
306impl Module for ObjectModule {
307 fn isa(&self) -> &dyn TargetIsa {

Callers 2

declare_functionMethod · 0.85
declare_dataMethod · 0.85

Calls 3

BackendClass · 0.85
OkFunction · 0.85
containsMethod · 0.45

Tested by

no test coverage detected