8265150: AsyncGetCallTrace crashes on ResourceMark

Reviewed-by: dholmes, stuefe, eosterlund, sspitsyn
This commit is contained in:
Coleen Phillimore 2021-12-04 13:05:06 +00:00
parent 9642629d15
commit 267c024eb5
2 changed files with 6 additions and 9 deletions

View file

@ -324,14 +324,11 @@ int Method::bci_from(address bcp) const {
if (is_native() && bcp == 0) {
return 0;
}
#ifdef ASSERT
{
ResourceMark rm;
assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(),
"bcp doesn't belong to this method: bcp: " INTPTR_FORMAT ", method: %s",
p2i(bcp), name_and_sig_as_C_string());
}
#endif
// Do not have a ResourceMark here because AsyncGetCallTrace stack walking code
// may call this after interrupting a nested ResourceMark.
assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(),
"bcp doesn't belong to this method. bcp: " INTPTR_FORMAT, p2i(bcp));
return bcp - code_base();
}