From: Matthias Braun Date: Wed, 28 Nov 2007 15:46:57 +0000 (+0000) Subject: abort if switch gets too big X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=d2f332fcdd2e347b86ce0fa092f36d297328ff81;p=libfirm abort if switch gets too big [r16854] --- diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index 923c76eb6..a70c52e8f 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -2286,6 +2286,7 @@ static ir_node *create_Switch(ir_node *node) ir_node *sel = get_Cond_selector(node); ir_node *new_sel = be_transform_node(sel); int switch_min = INT_MAX; + int switch_max = INT_MIN; long default_pn = get_Cond_defaultProj(node); ir_node *new_node; const ir_edge_t *edge; @@ -2301,6 +2302,12 @@ static ir_node *create_Switch(ir_node *node) if(pn < switch_min) switch_min = pn; + if(pn > switch_max) + switch_max = pn; + } + + if((unsigned) (switch_max - switch_min) > 256000) { + panic("Size of switch %+F bigger than 256000", node); } if (switch_min != 0) {