mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
8031045: Access checks should precede additional per-instruction checks
Move access check above the check for non-static method Reviewed-by: lfoltan, coleenp
This commit is contained in:
parent
3529de993d
commit
fe0b2eae89
1 changed files with 10 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -649,16 +649,6 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nostatics && resolved_method->is_static()) {
|
|
||||||
ResourceMark rm(THREAD);
|
|
||||||
char buf[200];
|
|
||||||
jio_snprintf(buf, sizeof(buf), "Expected instance not static method %s", Method::name_and_sig_as_C_string(resolved_klass(),
|
|
||||||
resolved_method->name(),
|
|
||||||
resolved_method->signature()));
|
|
||||||
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (check_access) {
|
if (check_access) {
|
||||||
// JDK8 adds non-public interface methods, and accessability check requirement
|
// JDK8 adds non-public interface methods, and accessability check requirement
|
||||||
assert(current_klass.not_null() , "current_klass should not be null");
|
assert(current_klass.not_null() , "current_klass should not be null");
|
||||||
|
@ -702,6 +692,15 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nostatics && resolved_method->is_static()) {
|
||||||
|
ResourceMark rm(THREAD);
|
||||||
|
char buf[200];
|
||||||
|
jio_snprintf(buf, sizeof(buf), "Expected instance not static method %s",
|
||||||
|
Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
|
resolved_method->name(), resolved_method->signature()));
|
||||||
|
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
||||||
|
}
|
||||||
|
|
||||||
if (TraceItables && Verbose) {
|
if (TraceItables && Verbose) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
tty->print("invokeinterface resolved method: caller-class:%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ",
|
tty->print("invokeinterface resolved method: caller-class:%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue