mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
If method being parsed is named <clinit>, throw ClassFormatError if it is not void or has arguments, for class file version >= 51. Reviewed-by: acorn, lfoltan
This commit is contained in:
parent
fd47033053
commit
3756d55ee6
7 changed files with 173 additions and 19 deletions
|
@ -2846,7 +2846,7 @@ void ClassVerifier::verify_invoke_instructions(
|
|||
if (sig_stream.type() != T_VOID) {
|
||||
if (method_name == vmSymbols::object_initializer_name()) {
|
||||
// <init> method must have a void return type
|
||||
/* Unreachable? Class file parser verifies that <init> methods have
|
||||
/* Unreachable? Class file parser verifies that methods with '<' have
|
||||
* void return */
|
||||
verify_error(ErrorContext::bad_code(bci),
|
||||
"Return type must be void in <init> method");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue