(name: &str)
| 293 | } |
| 294 | |
| 295 | fn 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 | |
| 306 | impl Module for ObjectModule { |
| 307 | fn isa(&self) -> &dyn TargetIsa { |
no test coverage detected