Skip to content

Commit

Permalink
Prefer cleaner API
Browse files Browse the repository at this point in the history
Also, tighten up error message
  • Loading branch information
CalebFenton committed Oct 16, 2018
1 parent 3fb5b53 commit 39678b9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions smalivm/src/main/java/org/cf/smalivm/opcode/InvokeOp.java
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,8 @@ private void executeLocalMethod(String methodSignature, ExecutionContext callerC
if (item.isUnknown()) {
log.warn("Method had possible execution path which throws an exception but cannot instantiate it because the value is unknown. Exception item: {}", item);
} else {
log.warn("Refusing to instantiate and throw potentially unsafe exception: {}. This is " +
"likely an input class and may need to be white listed to execute properly.",
item);
// May just need to whitelist Exception class
log.warn("Refusing to instantiate potentially unsafe thrown exception: {}.", item);
}
}
}
Expand All @@ -403,10 +402,7 @@ private void executeLocalMethod(String methodSignature, ExecutionContext callerC
if (!method.getReturnType().equals(CommonTypes.VOID)) {
// Terminating addresses may include throw ops which may not have a return register set
TIntList addresses = new TIntLinkedList();
for (int address : graph.getTerminatingAddresses()) {
if (!graph.wasAddressReached(address)) {
continue;
}
for (int address : graph.getConnectedTerminatingAddresses()) {
if (graph.getOp(address) instanceof ReturnOp) {
addresses.add(address);
}
Expand Down

0 comments on commit 39678b9

Please sign in to comment.