summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Kennard <[email protected]>2015-08-27 19:04:17 +0200
committerEmil Velikov <[email protected]>2015-08-31 13:16:22 +0100
commit68bd2ddda026afd5e45324d51a5b6b74227c5408 (patch)
tree82d360ef3abbae8aa3af49ea509b2a5b3a2928cb /src
parent9db5c2ca2ea8f4172611337db1cc81f19aab443e (diff)
r600g/sb: Don't crash on empty if jump target
Signed-off-by: Glenn Kennard <[email protected]> Cc: <[email protected]> Signed-off-by: Dave Airlie <[email protected]> (cherry picked from commit 608c7b4a63d5818f7ae0b3d48496b02cf8458d9b)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r600/sb/sb_bc_parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
index 748aae29eeb..c4799270d9f 100644
--- a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
+++ b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
@@ -792,6 +792,9 @@ int bc_parser::prepare_if(cf_node* c) {
assert(c->bc.addr-1 < cf_map.size());
cf_node *c_else = NULL, *end = cf_map[c->bc.addr];
+ if (!end)
+ return 0; // not quite sure how this happens, malformed input?
+
BCP_DUMP(
sblog << "parsing JUMP @" << c->bc.id;
sblog << "\n";
@@ -817,7 +820,7 @@ int bc_parser::prepare_if(cf_node* c) {
if (c_else->parent != c->parent)
c_else = NULL;
- if (end->parent != c->parent)
+ if (end && end->parent != c->parent)
end = NULL;
region_node *reg = sh->create_region();