mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-8316 DCEVM: Allow idnum to exceed total method count
This commit is contained in:
@@ -375,8 +375,6 @@ inline int Backtrace::get_line_number(Method* method, int bci) {
|
||||
// "no LineNumberTable". JDK tests for -2.
|
||||
line_number = -2;
|
||||
} else {
|
||||
// (DCEVM): Line numbers from the newest version must be used
|
||||
method = method->newest_version();
|
||||
// Returns -1 if no LineNumberTable, and otherwise actual line number
|
||||
line_number = method->line_number_from_bci(bci);
|
||||
}
|
||||
|
||||
@@ -4433,15 +4433,19 @@ Method* InstanceKlass::method_with_idnum(int idnum) {
|
||||
|
||||
Method* InstanceKlass::method_with_orig_idnum(int idnum) {
|
||||
if (idnum >= methods()->length()) {
|
||||
return nullptr;
|
||||
}
|
||||
Method* m = methods()->at(idnum);
|
||||
if (m != nullptr && m->orig_method_idnum() == idnum) {
|
||||
return m;
|
||||
// (DCEVM) The provided idnum may exceed the current number of methods.
|
||||
if (!AllowEnhancedClassRedefinition) {
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
Method* m = methods()->at(idnum);
|
||||
if (m != nullptr && m->orig_method_idnum() == idnum) {
|
||||
return m;
|
||||
}
|
||||
}
|
||||
// Obsolete method idnum does not match the original idnum
|
||||
for (int index = 0; index < methods()->length(); ++index) {
|
||||
m = methods()->at(index);
|
||||
Method* m = methods()->at(index);
|
||||
if (m->orig_method_idnum() == idnum) {
|
||||
return m;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user