< prev index next > src/java.base/share/classes/jdk/internal/classfile/impl/verifier/ParserVerifier.java
Print this page
import java.util.function.ToIntFunction;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.Util;
! import static java.lang.constant.ConstantDescs.CLASS_INIT_NAME;
- import static java.lang.constant.ConstantDescs.INIT_NAME;
/// ParserVerifier performs selected checks of the class file format according to
/// {@jvms 4.8 Format Checking}.
///
/// From `classFileParser.cpp`.
import java.util.function.ToIntFunction;
import jdk.internal.classfile.impl.BoundAttribute;
import jdk.internal.classfile.impl.Util;
! import static java.lang.constant.ConstantDescs.*;
/// ParserVerifier performs selected checks of the class file format according to
/// {@jvms 4.8 Format Checking}.
///
/// From `classFileParser.cpp`.
}
yield 2 + 8 * ica.classes().size();
}
case LineNumberTableAttribute lta ->
2 + 4 * lta.lineNumbers().size();
+ case LoadableDescriptorsAttribute lda -> {
+ for (var desc : lda.loadableDescriptorSymbols()) {
+ if (desc.equals(CD_void)) {
+ errors.add(new VerifyError("illegal signature %s".formatted(desc)));
+ }
+ }
+ yield 2 + 2 * lda.loadableDescriptors().size();
+ }
case LocalVariableTableAttribute lvta ->
2 + 10 * lvta.localVariables().size();
case LocalVariableTypeTableAttribute lvta ->
2 + 10 * lvta.localVariableTypes().size();
case MethodParametersAttribute mpa ->
}
case SourceIDAttribute sida -> {
sida.sourceId();
yield 2;
}
! case StackMapTableAttribute smta ->
! 2 + subSize(smta.entries(), frame -> stackMapFrameSize(frame));
case SyntheticAttribute _ ->
0;
case UnknownAttribute _ ->
-1;
case CustomAttribute<?> _ ->
}
case SourceIDAttribute sida -> {
sida.sourceId();
yield 2;
}
! case StackMapTableAttribute _ ->
! -1; // Not sufficient info for assert unset size
case SyntheticAttribute _ ->
0;
case UnknownAttribute _ ->
-1;
case CustomAttribute<?> _ ->
< prev index next >