mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8135265: VM fails on 'empty' interface public <init>()V method with VerifyError
Don't check for calls to super() or this() fro <init>()V methods if they are in interfaces. Because, they are not ctors. Reviewed-by: acorn, gtriantafill
This commit is contained in:
parent
1890d7a430
commit
d01e8e3c74
1 changed files with 4 additions and 2 deletions
|
@ -1579,9 +1579,11 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) {
|
|||
return;
|
||||
}
|
||||
// Make sure "this" has been initialized if current method is an
|
||||
// <init>
|
||||
// <init>. Note that "<init>" methods in interfaces are just
|
||||
// normal methods. Interfaces cannot have ctors.
|
||||
if (_method->name() == vmSymbols::object_initializer_name() &&
|
||||
current_frame.flag_this_uninit()) {
|
||||
current_frame.flag_this_uninit() &&
|
||||
!current_class()->is_interface()) {
|
||||
verify_error(ErrorContext::bad_code(bci),
|
||||
"Constructor must call super() or this() "
|
||||
"before return");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue