Fix disassembly INVOKEVIRTUAL without symbols
If there were no debug symbols, the constant pool isn't extended to hold all methods. This caused a method name resolution to fail if main called a method. This change takes care of this edge case and immediately resolves to None, causing the default placeholders to be generated.
This commit is contained in:
@@ -54,6 +54,9 @@ impl DebugSymbols {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn lookup_method_idx(&self, idx: usize) -> Option<String> {
|
fn lookup_method_idx(&self, idx: usize) -> Option<String> {
|
||||||
|
if idx >= self.constants.len() {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
match self.methods.get(&self.constants[idx]) {
|
match self.methods.get(&self.constants[idx]) {
|
||||||
Some(name) => Some(name.to_string()),
|
Some(name) => Some(name.to_string()),
|
||||||
None => None,
|
None => None,
|
||||||
|
|||||||
Reference in New Issue
Block a user