Skip to content

Commit

Permalink
Ignore Error type in VerifyDebugUsage.
Browse files Browse the repository at this point in the history
`BundleLauncher` raises `Error` and that lets `checkSVMInvariants()` fail.
  • Loading branch information
fniephaus committed Nov 6, 2023
1 parent 9b89841 commit ae2de06
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,24 @@ protected void verify(StructuredGraph graph, CoreProviders context) {
ResolvedJavaType nodeType = metaAccess.lookupJavaType(Node.class);
ResolvedJavaType stringType = metaAccess.lookupJavaType(String.class);
ResolvedJavaType graalErrorType = metaAccess.lookupJavaType(GraalError.class);
ResolvedJavaType errorType = metaAccess.lookupJavaType(Error.class);

for (MethodCallTargetNode t : graph.getNodes(MethodCallTargetNode.TYPE)) {
ResolvedJavaMethod callee = t.targetMethod();
String calleeName = callee.getName();
if (callee.getDeclaringClass().equals(debugType)) {
ResolvedJavaType calleeDeclaringClass = callee.getDeclaringClass();
if (calleeDeclaringClass.equals(debugType)) {
boolean isDump = calleeName.equals("dump");
if (calleeName.equals("log") || calleeName.equals("logAndIndent") || calleeName.equals("verify") || isDump) {
verifyParameters(metaAccess, t, t.arguments(), stringType, isDump ? 2 : 1);
}
}
if (callee.getDeclaringClass().isAssignableFrom(nodeType)) {
if (calleeDeclaringClass.isAssignableFrom(nodeType)) {
if (calleeName.equals("assertTrue") || calleeName.equals("assertFalse")) {
verifyParameters(metaAccess, t, t.arguments(), stringType, 1);
}
}
if (callee.getDeclaringClass().isAssignableFrom(graalErrorType) && !graph.method().getDeclaringClass().isAssignableFrom(graalErrorType)) {
if (calleeDeclaringClass.isAssignableFrom(graalErrorType) && !calleeDeclaringClass.equals(errorType) && !graph.method().getDeclaringClass().isAssignableFrom(graalErrorType)) {
if (calleeName.equals("guarantee")) {
verifyParameters(metaAccess, t, t.arguments(), stringType, 0);
}
Expand Down

0 comments on commit ae2de06

Please sign in to comment.