Commit 0e50b34e authored by Michael Beck's avatar Michael Beck
Browse files

BugFix: The param_weight array must be allocated even if no parameters are available

[r6879]
parent 25c5ae6f
......@@ -398,14 +398,16 @@ static void analyze_method_params_weight(entity *ent)
mtp = get_entity_type(ent);
nparams = get_method_n_params(mtp);
/* allocate a new array. currently used as 'analysed' flag */
ent->param_weight = NEW_ARR_F(float, nparams);
/* If the method haven't parameters we have
* nothing to do.
*/
if (nparams <= 0)
return;
ent->param_weight = NEW_ARR_F(float, nparams);
irg = get_entity_irg(ent);
irg = get_entity_irg(ent);
/* First we initialize the parameter weight with 0. */
for (i = nparams - 1; i >= 0; i--)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment