mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-24 09:19:25 +00:00
Add "Metadata" symbol to Symbol enum
This commit is contained in:
@ -43,6 +43,7 @@ struct ShortNames {}
|
||||
impl SymbolRegistry for ShortNames {
|
||||
fn symbol_to_name(&self, symbol: Symbol) -> String {
|
||||
match symbol {
|
||||
Symbol::Metadata(prefix) => format!("M{}", prefix),
|
||||
Symbol::LocalFunction(index) => format!("f{}", index.index()),
|
||||
Symbol::Section(index) => format!("s{}", index.index()),
|
||||
Symbol::FunctionCallTrampoline(index) => format!("t{}", index.index()),
|
||||
@ -55,6 +56,10 @@ impl SymbolRegistry for ShortNames {
|
||||
return None;
|
||||
}
|
||||
let (ty, idx) = name.split_at(1);
|
||||
if ty.starts_with('M') {
|
||||
return Some(Symbol::Metadata(idx.to_string()));
|
||||
}
|
||||
|
||||
let idx = idx.parse::<u32>().ok()?;
|
||||
match ty.chars().next().unwrap() {
|
||||
'f' => Some(Symbol::LocalFunction(LocalFunctionIndex::from_u32(idx))),
|
||||
|
Reference in New Issue
Block a user