Skip to content

Commit b49de58

Browse files
committed
[GR-62526] Stop processing on malformed input in IntrinsicStubProcessor.
PullRequest: graal/20143
2 parents 3cae6b4 + d60a931 commit b49de58

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/src/jdk.graal.compiler.processor/src/jdk/graal/compiler/lir/processor/IntrinsicStubProcessor.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ enum TargetVM {
7272
private TypeElement generateStub;
7373
private TypeElement generateStubs;
7474
private TypeMirror constantNodeParameter;
75+
private boolean malformedInput = false;
7576

7677
@Override
7778
public Set<String> getSupportedAnnotationTypes() {
@@ -182,7 +183,9 @@ protected boolean doProcess(Set<? extends TypeElement> annotations, RoundEnviron
182183
}
183184
classes.add(new GenerateStubClass(source, stubs, minimumFeatureGetters.keySet()));
184185
}
185-
createStubs(this, targetVM, (TypeElement) holder, classes);
186+
if (!malformedInput) {
187+
createStubs(this, targetVM, (TypeElement) holder, classes);
188+
}
186189
}
187190
}
188191
return true;
@@ -198,6 +201,7 @@ private void extractStubs(TargetVM targetVM,
198201
if (getAnnotation(method, nodeIntrinsic.asType()) == null) {
199202
String msg = String.format("methods annotated with %s must also be annotated with %s", annotation, nodeIntrinsic);
200203
env().getMessager().printMessage(Diagnostic.Kind.ERROR, msg, method, annotation);
204+
malformedInput = true;
201205
}
202206
RuntimeCheckedFlagsMethod rtc = findRuntimeCheckedFlagsVariant(this, source, method, annotation);
203207
for (AnnotationMirror generateStubAnnotationValue : generateStubAnnotations) {
@@ -232,6 +236,7 @@ private RuntimeCheckedFlagsMethod findRuntimeCheckedFlagsVariant(AbstractProcess
232236
processor.env().getMessager().printMessage(Diagnostic.Kind.ERROR, method + ": Could not find runtime checked flags variant. " +
233237
"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.",
234238
method, annotation);
239+
malformedInput = true;
235240
return null;
236241
}
237242

0 commit comments

Comments
 (0)