8180617: Null pointer dereference in InitializeNode::complete_stores
Fixed a missing null check on the return value of InitializeNode::allocation() found by Parfait. Reviewed-by: zmajo
This commit is contained in:
parent
bbe61a3c5d
commit
66fb50e7a2
@ -3947,9 +3947,10 @@ Node* InitializeNode::complete_stores(Node* rawctl, Node* rawmem, Node* rawptr,
|
|||||||
// if it is the last unused 4 bytes of an instance, forget about it
|
// if it is the last unused 4 bytes of an instance, forget about it
|
||||||
intptr_t size_limit = phase->find_intptr_t_con(size_in_bytes, max_jint);
|
intptr_t size_limit = phase->find_intptr_t_con(size_in_bytes, max_jint);
|
||||||
if (zeroes_done + BytesPerLong >= size_limit) {
|
if (zeroes_done + BytesPerLong >= size_limit) {
|
||||||
assert(allocation() != NULL, "");
|
AllocateNode* alloc = allocation();
|
||||||
if (allocation()->Opcode() == Op_Allocate) {
|
assert(alloc != NULL, "must be present");
|
||||||
Node* klass_node = allocation()->in(AllocateNode::KlassNode);
|
if (alloc != NULL && alloc->Opcode() == Op_Allocate) {
|
||||||
|
Node* klass_node = alloc->in(AllocateNode::KlassNode);
|
||||||
ciKlass* k = phase->type(klass_node)->is_klassptr()->klass();
|
ciKlass* k = phase->type(klass_node)->is_klassptr()->klass();
|
||||||
if (zeroes_done == k->layout_helper())
|
if (zeroes_done == k->layout_helper())
|
||||||
zeroes_done = size_limit;
|
zeroes_done = size_limit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user