8239069: C2: SIGSEGV in IdealGraphPrinter::walk_nodes due to C->root() being NULL

Fix NULL pointer dereference when trying to print the ideal graph when Compile::record_failure() is called twice.

Reviewed-by: neliasso, thartmann
This commit is contained in:
Christian Hagedorn 2020-02-17 12:29:24 +01:00
parent b369aefc79
commit 74bee68872

View File

@ -664,7 +664,7 @@ void IdealGraphPrinter::print_method(const char *name, int level) {
// Print current ideal graph
void IdealGraphPrinter::print(const char *name, Node *node) {
if (!_current_method || !_should_send_method) return;
if (!_current_method || !_should_send_method || node == NULL) return;
// Warning, unsafe cast?
_chaitin = (PhaseChaitin *)C->regalloc();