commit | 438f38c55afc8a31d01af357de95a56044ea7055 | [log] [tgz] |
---|---|---|
author | Eric Anholt <eric@anholt.net> | Thu Apr 29 13:54:19 2010 -0700 |
committer | Eric Anholt <eric@anholt.net> | Thu Apr 29 13:54:19 2010 -0700 |
tree | a96fb0523f5c5ed6141ee26f24467a2d33405ee3 | |
parent | a2c6df556655e3619f5a0cd82b0d11aac37c5692 [diff] [blame] |
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 81fbeba..a73e9ed 100644 --- a/ir_dead_code.cpp +++ b/ir_dead_code.cpp
@@ -251,7 +251,10 @@ 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); }