Skip to content

Commit

Permalink
Stop processing on malformed input in IntrinsicStubProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
djoooooe committed Feb 24, 2025
1 parent 85d8d22 commit d60a931
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ enum TargetVM {
private TypeElement generateStub;
private TypeElement generateStubs;
private TypeMirror constantNodeParameter;
private boolean malformedInput = false;

@Override
public Set<String> getSupportedAnnotationTypes() {
Expand Down Expand Up @@ -182,7 +183,9 @@ protected boolean doProcess(Set<? extends TypeElement> annotations, RoundEnviron
}
classes.add(new GenerateStubClass(source, stubs, minimumFeatureGetters.keySet()));
}
createStubs(this, targetVM, (TypeElement) holder, classes);
if (!malformedInput) {
createStubs(this, targetVM, (TypeElement) holder, classes);
}
}
}
return true;
Expand All @@ -198,6 +201,7 @@ private void extractStubs(TargetVM targetVM,
if (getAnnotation(method, nodeIntrinsic.asType()) == null) {
String msg = String.format("methods annotated with %s must also be annotated with %s", annotation, nodeIntrinsic);
env().getMessager().printMessage(Diagnostic.Kind.ERROR, msg, method, annotation);
malformedInput = true;
}
RuntimeCheckedFlagsMethod rtc = findRuntimeCheckedFlagsVariant(this, source, method, annotation);
for (AnnotationMirror generateStubAnnotationValue : generateStubAnnotations) {
Expand Down Expand Up @@ -232,6 +236,7 @@ private RuntimeCheckedFlagsMethod findRuntimeCheckedFlagsVariant(AbstractProcess
processor.env().getMessager().printMessage(Diagnostic.Kind.ERROR, method + ": Could not find runtime checked flags variant. " +
"For every method annotated with @GenerateStub, a second @NodeIntrinsic method with the same signature + an additional @ConstantNodeParameter EnumSet<CPUFeature> parameter for runtime checked CPU flags is required.",
method, annotation);
malformedInput = true;
return null;
}

Expand Down

0 comments on commit d60a931

Please sign in to comment.