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:
2019-04-18 00:20:37 +02:00
parent 83661f21aa
commit 932abd0cb2

View File

@@ -54,6 +54,9 @@ impl DebugSymbols {
}
fn lookup_method_idx(&self, idx: usize) -> Option<String> {
if idx >= self.constants.len() {
return None;
}
match self.methods.get(&self.constants[idx]) {
Some(name) => Some(name.to_string()),
None => None,