mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8042727: nsk/jdb/unwatch/unwatch001 crash in InstanceKlass::methods_do(void (*)(Method*))
Only walk methods in instanceklass if the class is loaded Reviewed-by: dholmes, fparain
This commit is contained in:
parent
7f721c111b
commit
ead7a2760b
5 changed files with 17 additions and 2 deletions
|
@ -1273,6 +1273,12 @@ bool InstanceKlass::find_field_from_offset(int offset, bool is_static, fieldDesc
|
|||
|
||||
|
||||
void InstanceKlass::methods_do(void f(Method* method)) {
|
||||
// Methods aren't stable until they are loaded. This can be read outside
|
||||
// a lock through the ClassLoaderData for profiling
|
||||
if (!is_loaded()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int len = methods()->length();
|
||||
for (int index = 0; index < len; index++) {
|
||||
Method* m = methods()->at(index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue