8257632: C2: Late inlining attempt on a call with a dead memory crashes

Reviewed-by: neliasso, kvn, thartmann
This commit is contained in:
Vladimir Ivanov 2020-12-04 07:55:04 +00:00
parent 6845fee905
commit 417e7e6317
2 changed files with 7 additions and 0 deletions

View File

@ -363,6 +363,12 @@ void LateInlineCallGenerator::do_late_inline() {
assert(Compile::current()->inlining_incrementally(), "shouldn't happen during parsing");
return;
}
if (call->in(TypeFunc::Memory)->is_MergeMem()) {
MergeMemNode* merge_mem = call->in(TypeFunc::Memory)->as_MergeMem();
if (merge_mem->base_memory() == merge_mem->empty_memory()) {
return; // dead path
}
}
// check for unreachable loop
CallProjections callprojs;

View File

@ -1460,6 +1460,7 @@ void GraphKit::replace_in_map(Node* old, Node* neww) {
Node* GraphKit::memory(uint alias_idx) {
MergeMemNode* mem = merged_memory();
Node* p = mem->memory_at(alias_idx);
assert(p != mem->empty_memory(), "empty");
_gvn.set_type(p, Type::MEMORY); // must be mapped
return p;
}