diff --git a/src/gallium/drivers/r600/sb/sb_gcm.cpp b/src/gallium/drivers/r600/sb/sb_gcm.cpp index bccb671..39b6cdd 100644 --- a/src/gallium/drivers/r600/sb/sb_gcm.cpp +++ b/src/gallium/drivers/r600/sb/sb_gcm.cpp @@ -577,7 +577,7 @@ void gcm::bu_find_best_bb(node *n, op_info &oi) { // For now just check if top_bb's loop_level is higher than of // current bb and abort the search for better bb in such case, // but this problem may require more complete (and more expensive) fix - if (top_bb->loop_level <= best_bb->loop_level) { + if ((top_bb) && (top_bb->loop_level <= best_bb->loop_level)) { while (c && c != top_bb) { if (c->prev) {