提交 32822097 编写于 作者: T thartmann

8180617: Null pointer dereference in InitializeNode::complete_stores

Summary: Fixed a missing null check on the return value of InitializeNode::allocation() found by Parfait.
Reviewed-by: zmajo
上级 53ac650d
......@@ -4035,9 +4035,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
intptr_t size_limit = phase->find_intptr_t_con(size_in_bytes, max_jint);
if (zeroes_done + BytesPerLong >= size_limit) {
assert(allocation() != NULL, "");
if (allocation()->Opcode() == Op_Allocate) {
Node* klass_node = allocation()->in(AllocateNode::KlassNode);
AllocateNode* alloc = allocation();
assert(alloc != NULL, "must be present");
if (alloc != NULL && alloc->Opcode() == Op_Allocate) {
Node* klass_node = alloc->in(AllocateNode::KlassNode);
ciKlass* k = phase->type(klass_node)->is_klassptr()->klass();
if (zeroes_done == k->layout_helper())
zeroes_done = size_limit;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册