mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8180813: Null pointer dereference of CodeCache::find_blob() result
Fixed missing null checks on the result of CodeCache::find_blob() found by Parfait. Reviewed-by: shade, kvn
This commit is contained in:
parent
7d97ce96dd
commit
83a3e9f114
2 changed files with 5 additions and 5 deletions
|
@ -549,7 +549,7 @@ address SharedRuntime::get_poll_stub(address pc) {
|
|||
CodeBlob *cb = CodeCache::find_blob(pc);
|
||||
|
||||
// Should be an nmethod
|
||||
assert(cb && cb->is_compiled(), "safepoint polling: pc must refer to an nmethod");
|
||||
guarantee(cb != NULL && cb->is_compiled(), "safepoint polling: pc must refer to an nmethod");
|
||||
|
||||
// Look up the relocation information
|
||||
assert(((CompiledMethod*)cb)->is_at_poll_or_poll_return(pc),
|
||||
|
@ -1802,7 +1802,7 @@ bool SharedRuntime::should_fixup_call_destination(address destination, address e
|
|||
if (destination != entry_point) {
|
||||
CodeBlob* callee = CodeCache::find_blob(destination);
|
||||
// callee == cb seems weird. It means calling interpreter thru stub.
|
||||
if (callee == cb || callee->is_adapter_blob()) {
|
||||
if (callee != NULL && (callee == cb || callee->is_adapter_blob())) {
|
||||
// static call or optimized virtual
|
||||
if (TraceCallFixup) {
|
||||
tty->print("fixup callsite at " INTPTR_FORMAT " to compiled code for", p2i(caller_pc));
|
||||
|
@ -1851,7 +1851,7 @@ IRT_LEAF(void, SharedRuntime::fixup_callers_callsite(Method* method, address cal
|
|||
// ask me how I know this...
|
||||
|
||||
CodeBlob* cb = CodeCache::find_blob(caller_pc);
|
||||
if (!cb->is_compiled() || entry_point == moop->get_c2i_entry()) {
|
||||
if (cb == NULL || !cb->is_compiled() || entry_point == moop->get_c2i_entry()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue