mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
C: fix bug in exception handling
This commit is contained in:
parent
81cc3c156e
commit
beef9e09ca
|
@ -499,7 +499,7 @@ public class CodeGenerationVisitor implements ExprVisitor, StatementVisitor {
|
|||
|
||||
pushLocation(expr.getLocation());
|
||||
|
||||
if (needsCallSiteId() && context.getCharacteristics().isManaged(expr.getMethod())) {
|
||||
if (needsCallSiteId() && isManagedMethodCall(context.getCharacteristics(), expr.getMethod())) {
|
||||
needParenthesis = true;
|
||||
withCallSite();
|
||||
}
|
||||
|
|
|
@ -283,17 +283,13 @@ public class ExceptionHandlingShadowStackContributor {
|
|||
|| insn instanceof NullCheckInstruction || insn instanceof BoundCheckInstruction) {
|
||||
return true;
|
||||
} else if (insn instanceof InvokeInstruction) {
|
||||
MethodReference method = ((InvokeInstruction) insn).getMethod();
|
||||
if (method.equals(FILL_STACK_TRACE)) {
|
||||
return true;
|
||||
}
|
||||
return isManagedMethodCall(characteristics, method);
|
||||
return isManagedMethodCall(characteristics, ((InvokeInstruction) insn).getMethod());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isManagedMethodCall(Characteristics characteristics, MethodReference method) {
|
||||
if (characteristics.isManaged(method)) {
|
||||
if (characteristics.isManaged(method) || method.equals(FILL_STACK_TRACE)) {
|
||||
return true;
|
||||
}
|
||||
return method.getClassName().equals(ExceptionHandling.class.getName())
|
||||
|
|
Loading…
Reference in New Issue
Block a user