From 438f38c55afc8a31d01af357de95a56044ea7055 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 29 Apr 2010 13:54:19 -0700 Subject: [PATCH] ir_dead_code: Fix segfault on handling a return statement with no value. --- ir_dead_code.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ir_dead_code.cpp b/ir_dead_code.cpp index 81fbeba3213..a73e9ed9bbb 100644 --- a/ir_dead_code.cpp +++ b/ir_dead_code.cpp @@ -251,7 +251,10 @@ ir_dead_code_visitor::visit(ir_call *ir) void ir_dead_code_visitor::visit(ir_return *ir) { - ir->get_value()->accept(this); + ir_rvalue *val = ir->get_value(); + + if (val) + val->accept(this); } -- 2.30.2