Fix disassembly wrong name for main

This commit is contained in:
2019-04-17 23:40:29 +02:00
parent 71daed8790
commit 83661f21aa

View File

@@ -353,10 +353,14 @@ impl Disassembler {
}
fn disasm_method(&mut self, i: i32, pc: usize, args: usize, vars: usize) -> Result<Method> {
let name = self
.symbols
.lookup_method(pc)
.unwrap_or_else(|| format!("func_{}", i));
let name = if pc == 0 {
"main".to_string()
} else {
self.symbols
.lookup_method(pc)
.unwrap_or_else(|| format!("func_{}", i))
};
let mut method = Method::new(name, pc, args, vars);
while self.text.has_i8() && !self.is_method(self.text.cur()) {