X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Freturn.c;h=3b5338aaf2563ab8da6fbd4295104578d9d7a746;hb=46de9c58b7126770f460c97a3b95b6e0402804f8;hp=82741bf9b000a56b7ab0d6d76727f4fb6cf3ccb1;hpb=6ec69d327b9bfd952743fd8ebc7848690cacaa18;p=libfirm diff --git a/ir/opt/return.c b/ir/opt/return.c index 82741bf9b..3b5338aaf 100644 --- a/ir/opt/return.c +++ b/ir/opt/return.c @@ -60,8 +60,13 @@ void normalize_one_return(ir_graph *irg) ir_node *block; /* look, if we have more than one return */ - n = get_Block_n_cfgpreds(endbl); - assert(n > 0); + n = get_Block_n_cfgpreds(endbl); + if (n <= 0) { + /* The end block has no predecessors, we have an endless + loop. In that case, no returns exists. */ + return; + } + returns = alloca((n + 7) >> 3); memset(returns, 0, (n + 7) >> 3);