Some thinking about exceptions

This commit is contained in:
Adam
2015-02-01 21:15:14 -05:00
parent 763d82379e
commit 027dc6eff9
7 changed files with 96 additions and 5 deletions

View File

@@ -1,9 +1,12 @@
package info.sigterm.deob.attributes.code;
import info.sigterm.deob.attributes.Code;
import info.sigterm.deob.execution.ObjectInstance;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
public class Exceptions
{
@@ -27,4 +30,20 @@ public class Exceptions
{
return code;
}
public Collection<Exception> getHandlersForPc(int pc)
{
ArrayList<Exception> matches = new ArrayList<Exception>();
for (Exception e : exceptions)
{
if (pc >= e.getStartPc() && pc < e.getEndPc())
{
/* possible match */
matches.add(e);
}
}
return matches;
}
}