From: Eric Anholt Date: Thu, 29 Apr 2010 20:54:19 +0000 (-0700) Subject: ir_dead_code: Fix segfault on handling a return statement with no value. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=438f38c55afc8a31d01af357de95a56044ea7055;p=mesa.git ir_dead_code: Fix segfault on handling a return statement with no value. --- 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); }