mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 17:39:40 +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.
|
// "no LineNumberTable". JDK tests for -2.
|
||||||
line_number = -2;
|
line_number = -2;
|
||||||
} else {
|
} 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
|
// Returns -1 if no LineNumberTable, and otherwise actual line number
|
||||||
line_number = method->line_number_from_bci(bci);
|
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) {
|
Method* InstanceKlass::method_with_orig_idnum(int idnum) {
|
||||||
if (idnum >= methods()->length()) {
|
if (idnum >= methods()->length()) {
|
||||||
return nullptr;
|
// (DCEVM) The provided idnum may exceed the current number of methods.
|
||||||
}
|
if (!AllowEnhancedClassRedefinition) {
|
||||||
Method* m = methods()->at(idnum);
|
return nullptr;
|
||||||
if (m != nullptr && m->orig_method_idnum() == idnum) {
|
}
|
||||||
return m;
|
} 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
|
// Obsolete method idnum does not match the original idnum
|
||||||
for (int index = 0; index < methods()->length(); ++index) {
|
for (int index = 0; index < methods()->length(); ++index) {
|
||||||
m = methods()->at(index);
|
Method* m = methods()->at(index);
|
||||||
if (m->orig_method_idnum() == idnum) {
|
if (m->orig_method_idnum() == idnum) {
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user